Category / Section
How to remove a column in GridDataBoundGrid?
1 min read
To remove a column from GridDataBoundGrid, grid.Binder.InternalColumns.Remove method can be used.
C#
GridBoundColumn column = this.gridDataBoundGrid1.Binder.InternalColumns["ContactName"]; //To remove the column using GridBoundColumn mapping name this.gridDataBoundGrid1.Binder.InternalColumns.Remove(column); //To remove column at the given index this.gridDataBoundGrid1.Binder.InternalColumns.RemoveAt(3);
VB
Dim column As GridBoundColumn = Me.gridDataBoundGrid1.Binder.InternalColumns("ContactName") 'To remove the column using GridBoundColumn mapping name Me.gridDataBoundGrid1.Binder.InternalColumns.Remove(column) 'To remove column at the given index Me.gridDataBoundGrid1.Binder.InternalColumns.RemoveAt(3)
Sample