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

RadGrid: How to create a generic footer format

4 Answers 273 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stacy
Top achievements
Rank 1
Stacy asked on 22 Jan 2010, 09:28 AM
I am using RadGrid which binds a stored procedure call to 1 DataSet.  The first column of the DataSet is "Supervisor" which I have set a grouping on.  All of the Supervisors are grouping correctly and works great.  However, I would like to add a Footer row to the bottom of each section of Supervisor Groupings.  Additionally, I would like to have a summary row for the entire RadGrid at the bottom.  I've added the appropriate  RadGrid.ShowFooter,  RadGrid.MasterTableView.ShowFooter  and  RadGrid.MasterTableView.ShowGroupFooter values to true.

Finally to my question.  For each Supervisor "group" section of data being returned from the stored procedure, I have the Footer summary row with custom calculations performed in the sproc itself.  At this point, all I want to do is display the results of that sproc as the Footer.  Unfortunately, the data is presumed to be part of the GridDataItems and not a GridFooterItem.  How do I configure the sproc and the RadGrid to presume the last row of each "group" is the Footer summary row?

Thanks in advance.

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Jan 2010, 10:13 AM
Hello Stacy,

You could set the Aggregate property of the column to Custom which inturn triggers the OnCustomAggregate event .Here the custom result(the stored procedure result,  in your case) can be set using the e.Result argument. You can use the demo below to get started with:
Footer Aggregates

In the demo, you can see that the footer value for the CustomerID column is set to the arguments.Result in the CustomAggregate event handler in the code-behind.

Hope this helps..
Princy.
0
Stacy
Top achievements
Rank 1
answered on 22 Jan 2010, 03:39 PM
Hi Princy,

Thanks for responding, I appreciate it!  :D  I don't think I explained myself well.  I do not want to call a secondary stored procedure to get the summary footer, it's already in my dataset.  In the example below, I have Grouping on the first column (Supervisor), 2 rows of agents, and the third row is "Totals" which is what I would like to act as a Footer..  The calculations that are in the Totals row is performed on the SQL side because they are custom from the backend.  e.g.

--------------------------------------------------------------------------------
Supervisor | Agent | Some Value 1 | Some Value 2
--------------------------------------------------------------------------------
John  | Bob  | 123    | 345
John  | Steve | 123    | 345
Totals  |   | 246    | 690
Stan  | Stacy | 234    | 456
Stan  | Clark | 234    | 456
Totals  |   | 468    | 912

So, the real question is, how do I make the RadGrid aware that the "Totals" rows are Footers?

Thanks, I appreciate your help!
0
Stacy
Top achievements
Rank 1
answered on 22 Jan 2010, 04:09 PM
I tried to attach an image but, I don't think it worked.  I don't see it anywhere on the post.
0
Yavor
Telerik team
answered on 28 Jan 2010, 06:30 AM
Hello Stacy,

Since you already have the data as a standard data item, you can hide this dataitem. and show all the relevant data in the footer of the grid, or the group footer of the group. The following article elaborates on the first option:

http://www.telerik.com/help/aspnet-ajax/grdtotalsingridfooters.html

For the second option, you can access all GridGroupGooter items, and setup the fields accordingly.
I hope these suggestions help.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Stacy
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Stacy
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or