Hiding unused columns

How can i hide unused columns in the DataBound Grid. I have it linked with a datatable that has 33 columns and i want the user to be able to select which columns should show. The only problem is that if i show 33 columns and then switch down to less even so those other columns are removed from DataBoundGrid1.GridBoundColumns they still appear during runtime as blank columns. How do i refresh the col count or is there something else im missing TIA, Peter

1 Reply

AD Administrator Syncfusion Team August 2, 2003 06:57 AM UTC

One way to get rid of the blank column is to reduce the grid.Model.ColCount.
private void button1_Click(object sender, EventArgs e)
{
	this.gridDataBoundGrid1.Binder.InternalColumns.RemoveAt(1);
	this.gridDataBoundGrid1.Model.ColCount -= 1;
	this.gridDataBoundGrid1.Refresh();
}

Loader.
Up arrow icon