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

Grouping Footer Templates?

3 Answers 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bryan Kowalchuk
Top achievements
Rank 1
Bryan Kowalchuk asked on 10 Nov 2010, 08:46 PM
I have a radGrid that contains some basic user entry that is grouped. It does exactly what I want. I also require some data entry fields that the user would use to add summary information for the group. The grouping footer is the perfect place to put these controls but my question how can I add data bound controls to grouping footer?

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 11 Nov 2010, 10:42 AM
Hi Bryan,

You can access the GridFooterItem in ItemCreated event and add the control to the cell as shown below.
 C#:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridFooterItem)
    {
        GridFooterItem footerItem = (GridFooterItem)e.Item;
        //add the desired control here
    }

Give it a try and see if it works for you.

Best wishes,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Bryan Kowalchuk
Top achievements
Rank 1
answered on 15 Nov 2010, 05:53 PM
Worked great once I changed GridFooterItem to GridGroupFooterItem, thanks!

Next question:

I need to do some data binding. I have been using the Grid_ItemDataBound event to find the control (RadTextbox) that was added to the footer. My question is, how can I find out the group that the control is currently in, preferably the Key ID of the group so that I can use the key value to retrieve the data and set the text for this text box?
0
Pavlina
Telerik team
answered on 16 Nov 2010, 04:23 PM
Hello Bryan,

You can reference the footer item of the control and use the column UniqueName property to identify the cell of interest:
GridFooterItem footerItem = RadGrid1.MasterTableView.GetItems(GridItemType.Footer)[0] as GridFooterItem;

Refer to this help article for more information:
http://www.telerik.com/help/aspnet-ajax/introduction.html

Sincerely yours,
Pavlina
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Bryan Kowalchuk
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Bryan Kowalchuk
Top achievements
Rank 1
Share this question
or