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.

Hiding/Unhiding the columns

Thread ID:

Created:

Updated:

Platform:

Replies:

19761 Oct 4,2004 06:00 AM Oct 4,2004 08:56 AM Windows Forms 2
loading
Tags: GridControl
Thiyagu
Asked On October 4, 2004 06:00 AM

Hi Clay, I''m using GDBG grid. Here I''m having a CheckBox in my form. When the User Checks the CheckBox I need to Hide some of the selected columns in the Grid and when the User Unchecks the CheckBox I need to Show all the Columns I tried with the follwing code but didn''t work. private void CheckBox1_CheckedChanged(object sender, System.EventArgs e) { try { if(this.CheckBox1.Checked) { for(int i = 1;i<=10;i++) { this.assignDesigGridDataBoundGrid_.Model.Cols.Hidden[i] = true; } } else { for(int i = 1;i<=10;i++) { this.assignDesigGridDataBoundGrid_.Model.Cols.Hidden[i] = false; } } } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }

Administrator [Syncfusion]
Replied On October 4, 2004 06:29 AM

Your code seems to work for me in this sample. (You may want to use a BeginUpdate/EndUpdate to avoid the flickering, but it seems to work as is.) HideColumns_8871.zip In your actual code, do you have an open BeginUpdate that does not have a matching EndUpdate? This could cause things not to redraw.

Thiyagu
Replied On October 4, 2004 08:56 AM

Yeh Clay.. I''ve missed out the EndUpdate.. Thanks Clay. >Your code seems to work for me in this sample. (You may want to use a BeginUpdate/EndUpdate to avoid the flickering, but it seems to work as is.) >HideColumns_8871.zip > >In your actual code, do you have an open BeginUpdate that does not have a matching EndUpdate? This could cause things not to redraw. > >

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.

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.

;