how to get Group Header name in Summary row name

6 posts, 0 answers
  1. Kamalakannan
    Kamalakannan avatar
    8 posts
    Member since:
    Aug 2012

    Posted 23 Apr 2012 Link to this post

    how to get Group Header name as Summary row name. Please finnd the attached image for more clarification
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 23 Apr 2012 Link to this post

    Hello, 

    You can change the Group cell by subscribing to the ViewCellFormatting event. Please have a look at this help topic on Cell Formatting, especially the section on formatting no data cells. 

    Hope that helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Kamalakannan
    Kamalakannan avatar
    8 posts
    Member since:
    Aug 2012

    Posted 24 Apr 2012 Link to this post

    Richard Thanks for you prompt reply.

    I am not asking formating color of the cell. when i grouped the grouping has some header name .i need same grouping header name in summary row also and that will automatically change whenever the new grouping started.


  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 26 Apr 2012 Link to this post

    Hello Kamalakannan,

    You can customize the summary cell text and achieve the desired effect by handling the GroupSummaryEvaluate event. Consider the sample below:
    void radGridView1_GroupSummaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e)
    {
        if (e.Group != null)
        {
            e.FormatString = e.Group.Header;
        }
    }

    More information regarding summary rows is available in our online documentation

    If you have further questions, we will be glad to help.

    Greetings,
    Jack
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  6. Kamalakannan
    Kamalakannan avatar
    8 posts
    Member since:
    Aug 2012

    Posted 27 Apr 2012 Link to this post

    Jack,

    Thanks for your reply.

    But i have two group header and two group footer. If you dont mind please have look my attached file.

    when i use the below code it applies second group header name for both group footer.

    Please help on the same.

  7. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 30 Apr 2012 Link to this post

    Hi Kamalakannan,

    In this case you can use the SummaryItem.Name property to identify the correct summary item.
    void radGridView1_GroupSummaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e)
    {
        if (e.Group != null && e.SummaryItem.Name == "Value")
        {
            e.FormatString = e.Group.Header;
        }
    }

    I hope this helps.
     
    Regards,
    Jack
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready