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. Image for the cookie policy date
close icon

How do I hide a a specific GridColumnHeaderRow when the ggc has multiple level of grouping

I have a flat datasource that is bounded to a ggc and grouped by two fields.
I would like to hide the GridColumnHeaderRow at the first grouped level and only display it at the second group level or vice versa.

Having both GridCOlumnHeaderLevel visible at both group level is confusing and makes the ggc looks clutter.
I can access the rows in the QueryCellStyleInfo object but there's no way to hide it by doing something like e.Style.Visible = false;

3 Replies

HA haneefm Syncfusion Team August 10, 2007 06:23 PM UTC

Hi James,

You can handle the GroupedColumns.Changed event and set GroupByOptions.ShowColumnHeaders property to false when e.Index to requiredIndex(1th GroupLevel). Here is a code snippet that show this task.

//form's ctor
this.gridGroupingControl1.TableDescriptor.GroupedColumns.Changed += new Syncfusion.Collections.ListPropertyChangedEventHandler(GroupedColumns_Changed);

void GroupedColumns_Changed(object sender, Syncfusion.Collections.ListPropertyChangedEventArgs e)
{
if (e.Index == 0)
{
SortColumnDescriptor column = e.Item as SortColumnDescriptor;
this.gridGroupingControl1.TableDescriptor.Columns[column.Name ].GroupByOptions.ShowColumnHeaders = false;
}
}

Best regards,
Haneef


JB James Blibo August 12, 2007 11:40 PM UTC

This did not work. Event is being raised nut nothing happens.


HA haneefm Syncfusion Team August 13, 2007 09:34 PM UTC

Hi James,

I am not sure of what be might be causing this strange behavior without a working sample. I have tested this issue in attached sample with Essentail studio V.4.x/5.x. But i was not able to reproduce the issue. Is it possible for you to upload us a minimal sample or modify the attached sample to reproduce the issue here? This will help us to analyse the issue further.

GGC_GroupSample.zip

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon