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

accessing group by value in RadGrid footer

3 Answers 149 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
NVB
Top achievements
Rank 1
NVB asked on 21 May 2012, 11:29 PM

I am using Radgrid  and  have the following situation.
First GroupBy is  Product and with in product it is grouped by City 

PRODUCT Part A Part B
Produc AA
City:  New York
 Conractor 1 10 20
Cotnractor 2 12 8
Cotnractor 3 22 20
City Total 44 48
City:Chicago
Cotnractor3 22 12
contractor8 11 33
Contactor 10 24 10
City Total 57 55
Prodcut Total 101 103

Eveything works fin about the total and also I am inserting the labels accordingly in the group footer.

I need to make my group footer more readble i.e it should say  NewYork City Total and Chicago City Total  in the inner group
and  it should say Product AA Total for outr group  rather that standard label

How do I access the groupby value from its Groupfooter.

Thanks for you help



3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 May 2012, 07:55 AM
Hi,

Try the following code snippet to access the GridGroupFooterItem.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
 if (e.Item is GridGroupFooterItem)
 {
   GridGroupFooterItem item = (GridGroupFooterItem)e.Item;
   string text=item["UniqueName"].Text;
 }
}

Thanks,
Shinu.
0
NVB
Top achievements
Rank 1
answered on 22 May 2012, 06:41 PM
Thanks for the reply

I am getting space(&nbsp) when I read the column  and not the column values

FYI : I am grouping first on Product and next grouping would be city and those are displayed only in group header  and column  are not displayed. Should I be doing something else in 'Product' and 'City' Column to be avaialbe in group footer

I am using VB.net( though it is fine if you can provide c#)

Thanks
0
Daniel
Telerik team
answered on 25 May 2012, 02:48 PM
Hi,

I have attached a simple demo (C#) to this post.
Hope this helps.

Kind regards,
Daniel
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
General Discussions
Asked by
NVB
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
NVB
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or