AUTHOR: Richard Hellwege
DATE POSTED: May 25, 2018
How do I show different descriptions for the Group Footer and Grid Footer in the RadGrid? When I set a FooterAggregateFormatString on a column, the same FormatString is used for both the Group Footer and Grid Footer.
The ItemDataBound event can be used to override the text in the RadGrid column footer. The first step is to define the FooterAggregateFormatString so that it only contains the aggregate value, see below.
<
telerik:GridBoundColumn
DataField
=
"SampleColumn"
Aggregate
"Sum"
FooterAggregateFormatString
"{0}"
/>
The ItemDataBound event can then to used to modify the footer text based on whether it is a GroupFooterItem or GirdFooterItem.
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridFooterItem)
var valueFooterCell = (e.Item
as
GridFooterItem)[
];
valueFooterCell.Text =
"Grand Total: "
+ valueFooterCell.Text;
}
else
GridGroupFooterItem)
GridGroupFooterItem)[
"Subtotal: "
RadGrid ItemDataBound Event
Resources Buy Try