示例#1
0
        /// <summary>
        /// Sets the first column of the tree list view.
        /// </summary>
        /// <param name="pColumn">The first column properties.</param>
        public void SetFirstColumn(TreeListViewColumn pColumn)
        {
            this.Columns.CollectionChanged -= this.OnGridViewColumnsCollectionChanged;

            ExtendedGridViewColumn lColumn = ExtendedGridViewColumn.CreateFrom(pColumn, 0);

            if (this.Columns.Any())
            {
                this.Columns.RemoveAt(0);
            }

            if (this.Columns.Any())
            {
                this.Columns.Insert(0, lColumn);
            }
            else
            {
                this.Columns.Add(lColumn);
            }

            if (this.mGridViewColumnBackup.Any())
            {
                this.mGridViewColumnBackup.RemoveAt(0);
            }

            if (this.mGridViewColumnBackup.Any())
            {
                this.mGridViewColumnBackup.Insert(0, lColumn.Clone());
            }
            else
            {
                this.mGridViewColumnBackup.Add(lColumn.Clone());
            }

            this.UpdateColumns();

            this.Columns.CollectionChanged += this.OnGridViewColumnsCollectionChanged;
        }
示例#2
0
        /// <summary>
        /// Adds a new column to the tree list view.
        /// </summary>
        /// <param name="pColumn">The column to add.</param>
        public void AddColumn(TreeListViewColumn pColumn)
        {
            this.Columns.CollectionChanged -= this.OnGridViewColumnsCollectionChanged;

            ExtendedGridViewColumn lColumn = ExtendedGridViewColumn.CreateFrom(pColumn, this.Columns.Count);

            this.Columns.Add(lColumn);
            this.mGridViewColumnBackup.Add(lColumn.Clone());

            this.UpdateColumnHeaderVisibility();

            this.Columns.CollectionChanged += this.OnGridViewColumnsCollectionChanged;
        }