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

how to get Group Header name in Summary row name

5 Answers 130 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kamalakannan
Top achievements
Rank 1
Kamalakannan asked on 23 Apr 2012, 01:39 PM
how to get Group Header name as Summary row name. Please finnd the attached image for more clarification

5 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 23 Apr 2012, 02:49 PM
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
0
Kamalakannan
Top achievements
Rank 1
answered on 24 Apr 2012, 01:42 PM
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.


0
Jack
Telerik team
answered on 26 Apr 2012, 09:56 AM
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 >>
0
Kamalakannan
Top achievements
Rank 1
answered on 27 Apr 2012, 09:58 AM
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.

0
Jack
Telerik team
answered on 30 Apr 2012, 01:48 PM
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 >>
Tags
GridView
Asked by
Kamalakannan
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Kamalakannan
Top achievements
Rank 1
Jack
Telerik team
Share this question
or