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

Group Header Totals

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Allan
Top achievements
Rank 2
Allan asked on 14 Sep 2013, 03:37 PM

I know we can perform calculations and add them to a group header:

Private Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
 
    If TypeOf e.Item Is GridGroupHeaderItem Then
        Dim item As GridGroupHeaderItem = CType(e.Item, GridGroupHeaderItem)
        Dim groupDataRow As DataRowView = CType(e.Item.DataItem, DataRowView)
        item.DataCell.Text = (item.DataCell.Text + "; Avg: ")
        item.DataCell.Text = (item.DataCell.Text + (CType(groupDataRow("total"), Decimal) / Integer.Parse(groupDataRow("count").ToString)).ToString)
    End If
End Sub

But is there a way to just add the Column aggregate:
<telerik:GridBoundColumn DataField="Subject" FilterControlAltText="Filter Subject column"
HeaderText="Subject" SortExpression="Subject" UniqueName="Subject" ItemStyle-HorizontalAlign="Left"
FooterStyle-HorizontalAlign="Left" FooterText="Tickets " Aggregate="Count">
</telerik:GridBoundColumn>

Thank you in advance.




1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 19 Sep 2013, 10:50 AM
Hi Allan,

Please check out the following live example which demonstrates how to use the aggregate into the footer on the groups.

Regards,
Kostadin
Telerik
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 the blog feed now.
Tags
Grid
Asked by
Allan
Top achievements
Rank 2
Answers by
Kostadin
Telerik team
Share this question
or