This is a migrated thread and some comments may be shown as answers.

Collapsing all group rows.

1 Answer 102 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 28 Nov 2008, 04:31 PM
Hi All!

How I can collapsing all groupHeaders rows by programming grouping?

Source code of grouping:
            dataGridView.GroupDescriptions.Clear();  
            Telerik.Windows.Data.RadGroupDescription desc = new Telerik.Windows.Data.RadGroupDescription("LogicCall");  
            Telerik.Windows.Data.SumFunction funcCallDuration = new Telerik.Windows.Data.SumFunction("CallDuration""CallDuration""Duration:");  
            desc.AggregateFunctions.Add(funcCallDuration);  
            dataGridView.GroupDescriptions.Add(desc); 

PS. May I collapsing all groupHeader when user drag'n'drop fields to the grouping panel?

1 Answer, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 01 Dec 2008, 12:58 PM
Hi Andy,

You have to handle GridViewGroupRow loaded event to accomplish this behavior of the RadGridView control.
The problem is that GridViewGroupRow.IsExpanded property is bound to the underlying data object, and the default value of the data object for the IsExpanded property is true. I'm attaching a sample project that illustrates how to do this.

In the future we will expose RowCreated and CellCreated events for such purposes, as well as appropriate property with which you will be able to define GridViewGroupRow.IsExpanded and GridViewExpandableRow.IsExpanded (Hierarchy row) properties.

Regards,
Nedyalko Nikolov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Andy
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Share this question
or