show hide grid grouping control column headers

I am using the attached code for show/hide of column in grid grouping control.

For showing and hiding, click on the 1st cell of the grid grouping control, a window pops up and the user can show and hide the columns...

My problem is when i am using show/Hide of columns....the default index of column changes....

ex my column sequence is
col1,col2,col3,col4
if i remove col2 and again add col2..now my column sequence changes to
col1,col3,col4,col2...

I want that on show/Hide of column the sequence should remain the same ie col1,col2,col3,col4
If i show and hide any column....column sequence should never change...

I will be really thankfull if anyone could help me in this..

GridGroupingColumnchooser_cb6481c4.zip

2 Replies

RA Rajagopal Syncfusion Team September 18, 2007 02:31 AM UTC

Hi Prabhjeet,

Instead of removing the column from the TableDescriptor.Columns collection, remove it from the from the TableDescriptor.VisibleColumns collection. Then when showing it back, you can use the TableDescriptor.VisibleColumns.Insert method. Please try the code below.

// to remove the column
this.gridGroupingControl1.TableDescriptor.VisibleColumns.Remove(item.Text);

// to show it back
int ctr = this.gridGroupingControl1.TableDescriptor.Columns.IndexOf(item.Text);
this.gridGroupingControl1.TableDescriptor.VisibleColumns.Insert(ctr, item.Text);

Let me know if this helps.

Regards,
Rajagopal


JH Jignesh H. Sodvadiya April 13, 2011 05:49 AM UTC

Hello,

I am using Syncfusion Grid Grouping Control. I now facing little bit of problem with this grid. I am binding only Datatable with Multiple level Grouping display summary on Group Header. But i want to hide some of Group Header from Grid. So how i can do it ?

Thanks & Regards
Jignesh Patel


Loader.
Up arrow icon