DataGroup Rows replacement

3 posts, 1 answers
  1. Sara
    Sara avatar
    2 posts
    Member since:
    Jul 2010

    Posted 26 Jan 2012 Link to this post

    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. Answer
    Jack
    Admin
    Jack avatar
    2333 posts

    Posted 31 Jan 2012 Link to this post

    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).

  3. Sara
    Sara avatar
    2 posts
    Member since:
    Jul 2010

    Posted 31 Jan 2012 Link to this post

    Thank you!!  Exactly what I needed.
Back to Top