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

DataGroup Rows replacement

2 Answers 111 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sara
Top achievements
Rank 1
Sara asked on 26 Jan 2012, 08:23 PM
In the GroupSummaryEvaluate event, I want to loop through the data rows in the group looking for a row based on some criteria against the data in that row.  I then want to display some data from this row in the group description.  I can do this using e.Group.Rows.  However, the Rows property is marked as deprecated and the Items property is not accessible.  What is the best way to do this?

2 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 31 Jan 2012, 09:46 AM
Hello Sara,

You should access the GroupRow property and iterate its ChildRows collection. Here is a sample:
void radGridView1_GroupSummaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e)
{
    int sum = 0;
    foreach (GridViewRowInfo row in e.Group.GroupRow.ChildRows)
    {
        sum += (int)row.Cells["Value"].Value;
    }
    e.FormatString = "Sum: " + sum.ToString();
}

Do not hesitate to contact us, if you have further questions.
 
Kind regards,
Jack
the Telerik team

SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

0
Sara
Top achievements
Rank 1
answered on 31 Jan 2012, 02:42 PM
Thank you!!  Exactly what I needed.
Tags
GridView
Asked by
Sara
Top achievements
Rank 1
Answers by
Jack
Telerik team
Sara
Top achievements
Rank 1
Share this question
or