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

How to show column total groupheader

3 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Quang
Top achievements
Rank 1
Quang asked on 12 Mar 2013, 02:17 PM
Hello

Can you guilde me how to show sum of each colum when I do group by column. total value will show in groupHeader

Thank you

 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Mar 2013, 04:09 AM
Hi,

You can show total in group header as shown below.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridGroupHeaderItem)
    {
        GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item;
        DataRowView groupDataRow = (DataRowView)e.Item.DataItem;
        item.DataCell.Text = "$" + groupDataRow["UniqueName"].ToString())";
    }
}

Thanks,
Shinu
0
Quang
Top achievements
Rank 1
answered on 13 Mar 2013, 04:48 AM
Dear shinu

I mean total will display at top(groupheaer) of each column. can you help me this code, I just new about telerik control. I use "autogenerateColumn= true"

Thank you
0
Kostadin
Telerik team
answered on 15 Mar 2013, 11:50 AM
Hello Quang,

I suggest you to examine the following live demo which demonstrates how to customize Grid Group Header and Footer Templates.

Regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Quang
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Quang
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or