AdvancedDataGridView.TreeGridView.OnColumnAdded C# (CSharp) Method

OnColumnAdded() protected method

protected OnColumnAdded ( System.Windows.Forms.DataGridViewColumnEventArgs e ) : void
e System.Windows.Forms.DataGridViewColumnEventArgs
return void
        protected override void OnColumnAdded(DataGridViewColumnEventArgs e)
        {
            if (typeof(TreeGridColumn).IsAssignableFrom(e.Column.GetType()))
            {
                if (_expandableColumn == null)
                {
                    // identify the expanding column.
                    _expandableColumn = (TreeGridColumn)e.Column;
                }
                else
                {
                   // this.Columns.Remove(e.Column);
                    //throw new InvalidOperationException("Only one TreeGridColumn per TreeGridView is supported.");
                }
            }

            // Expandable Grid doesn't support sorting. This is just a limitation of the sample.
            e.Column.SortMode = DataGridViewColumnSortMode.NotSortable;

            base.OnColumnAdded(e);
        }