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

How to implement GroupByExpressions

1 Answer 239 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sandeep Pulkundwar
Top achievements
Rank 1
Sandeep Pulkundwar asked on 23 Jul 2010, 03:25 PM
Hi,
I want to implement GroupByExpressions  in RadGridView  but my requrement is
different I want Header with two GroupByExpressions .
I have used
GridGroupByExpression expression1 = new GridGroupByExpression(grdSearchResults.Columns[4]);
grdSearchResults.MasterGridViewTemplate.GroupByExpressions.Add(expression1);
GridGroupByExpression expression = new GridGroupByExpression();
expression.Expression = "TimeZone as TimeZone format \"{0}: {1}\" Group By TimeZone";                    
grdSearchResults.MasterGridViewTemplate.GroupByExpressions.Add(expression);
 but this is giving two trees for GroupByExpression. I want single GroupByExpressions  /Single Header but with two expression
Example:
Property Name:United Kingdom(TimeZone:Estern Standerd Time)

Can you please give me some suggessions please

Thanks

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 28 Jul 2010, 03:32 PM
Hi Sandeep Pulkundwar,

In the new version of RadGridView control this is supported functionality. You can use the following code snippet to apply grouping based on two conditions:

GroupDescriptor groupDescriptor = new GroupDescriptor();
groupDescriptor.GroupNames.Add(grdSearchResults.Columns[4].Name, ListSortDirection.Ascending);
groupDescriptor.GroupNames.Add("TimeZone", ListSortDirection.Ascending);
this.radGridView1.GroupDescriptors.Add(groupDescriptor);

Also, you can use the advanced expression mode:
this.radGridView1.GroupDescriptors.Expression = string.Format("{0}, TimeZone", grdSearchResults.Columns[4].Name);

I hope this helps.

Best wishes,
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Sandeep Pulkundwar
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or