コード例 #1
0
        internal void ChangeGrouping(GroupingType groupingType)
        {
            if (Collection == null)
            {
                return;
            }

            if (groupingType == GroupingType.IsSelected)
            {
                Collection.LiveGroupingProperties.Clear();
                Collection.LiveGroupingProperties.Add("IsSelected");
                Collection.IsLiveGroupingRequested = true;
            }
            else
            {
                Collection.IsLiveGroupingRequested = false;
            }

            // Prevent the collection from updating until outside of the using block.
            using (Collection.DeferRefresh())
            {
                Collection.GroupDescriptions.Clear();
                if (groupingType != GroupingType.None)
                {
                    Collection.GroupDescriptions.Add(new PropertyGroupDescription(groupingType.ToString()));
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Change the grouping property
        /// </summary>
        /// <param name="groupingType"></param>
        internal void ChangeGrouping(GroupingType groupingType)
        {
            if (Collection == null)
            {
                return;
            }

            // Prevent the collection from updating until outside of the using block.
            using (Collection.DeferRefresh())
            {
                Collection.GroupDescriptions.Clear();
                if (groupingType != GroupingType.None)
                {
                    Collection.GroupDescriptions.Add(new PropertyGroupDescription(groupingType.ToString()));
                }
            }
        }
コード例 #3
0
ファイル: GroupingControl.cs プロジェクト: ryu2048/xenadmin
        private Button NewButton(GroupingType groupType)
        {
            Button button = new Button();

            button.AutoSize                = true;
            button.AutoSizeMode            = AutoSizeMode.GrowAndShrink;
            button.Text                    = groupType.ToString();
            button.UseVisualStyleBackColor = true;

            button.TextAlign         = ContentAlignment.MiddleLeft;
            button.TextImageRelation = TextImageRelation.TextBeforeImage;
            button.Padding           = new Padding(0, 0, 2, 0);
            button.Image             = Properties.Resources.expanded_triangle;
            button.ImageAlign        = ContentAlignment.MiddleRight;

            button.Tag        = groupType;
            button.Click     += new EventHandler(button_Click);
            button.MouseDown += new MouseEventHandler(button_MouseDown);
            button.MouseUp   += new MouseEventHandler(button_MouseUp);
            button.MouseMove += new MouseEventHandler(button_MouseMove);

            return(button);
        }