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

Gruping

2 Answers 83 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 14 Sep 2008, 10:59 AM

Hello,

I dont know how to solve this:
 I have a RadGridView grouped by program code and I know that each group has always 2 rows. And I want in the GroupHeader to be displayed some data from not "group by" collumns from the second of the rows in that group. Is it possible?

2 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 15 Sep 2008, 01:15 PM
Hi Daniel,

Thank you for contacting us.

Yes, this is possible by processing the GroupSummaryEvaluate event. Consider the code snippet below:

grid.MasterGridViewTemplate.GroupByExpressions.Add(new GridGroupByExpression("Value GroupBy Value"));             
grid.GroupSumaryEvaluate += new GroupSummaryEvaluateEventHandler(grid_GroupSumaryEvaluate); 
 
void grid_GroupSumaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e) 
    if (e.Group.RowCount > 1) 
    { 
        e.FormatString = "Group value: " + e.Group[1].Cells["Value"].Value.ToString(); 
    } 
    else 
    { 
        e.FormatString = "This group contains only one row!"
    } 
 

I hope this helps. Should you have further questions, do not hesitate to ask.


Regards,
Jack
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Daniel
Top achievements
Rank 1
answered on 15 Sep 2008, 02:03 PM
Yes, it works fine, Thank you.
Tags
GridView
Asked by
Daniel
Top achievements
Rank 1
Answers by
Jack
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or