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

Radgrid Aggregate

1 Answer 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Carlos Quintero
Top achievements
Rank 2
Carlos Quintero asked on 15 Dec 2008, 06:25 PM
I am trying to change an aggregate value on a footer value in my radgrid.  I would like to be able to change the aggregate values based on the group header.  So, for example..if the group header value is "App to Funding %" , I would like the aggregate value to be an average...all other group headers I would like a sum.

I assume I would do this in the Radgrid1_ItemDataBound...however I am struggling with exactly what I need to do.  Here is what I have...that doesn't work:

 

If TypeOf e.Item Is GridGroupHeaderItem Then

 

 

Dim item As GridGroupHeaderItem = CType(e.Item, GridGroupHeaderItem)

 

 

Dim groupDataRow As DataRowView = CType(e.Item.DataItem, DataRowView)

 

 

Dim column As GridBoundColumn

 

 

For Each column In groupDataRow.DataView.Table.Columns

 

 

If item.DataCell.Text = "App to Funding %" Then

 

column.Aggregate = GridAggregateFunction.Avg

 

End If

 

 

Next

 

 

End If

 


Any suggestions?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 18 Dec 2008, 08:21 AM
Hello Carlos,

Attached to this message, is a small application, which handles a similar task.
I hope it helps.

All the best,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Carlos Quintero
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Share this question
or