We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hiding unused columns

Thread ID:

Created:

Updated:

Platform:

Replies:

6152 Aug 2,2003 12:57 AM UTC Aug 2,2003 06:57 AM UTC Windows Forms 1
loading
Tags: GridControl
Peter
Asked On August 2, 2003 12:57 AM UTC

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

Administrator [Syncfusion]
Replied On 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();
}

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;