I added a custom aggregate to a column that has an item template because it has a nifty rad tooltip to go with it. Anyway when I return the custom aggregate from the event, the grid adds the string "Custom : " to the footer cell, and I am wondering why? Also is there any other way to get rid of that other than what I had to do which was handle the footer cell in the ItemDataBound event as below?
Thanks,
Kevin
Thanks,
Kevin
<telerik:GridTemplateColumn AllowFiltering=
"false"
UniqueName=
"OtherPay"
HeaderText=
"Other<br />Pay"
>
<ItemTemplate>
<asp:Label runat=
"server"
ID=
"lblOtherPay"
>0</asp:Label>
<telerik:RadToolTip runat=
"server"
ID=
"ttPPED"
TargetControlID=
"lblOtherPay"
Position=
"BottomRight"
Title=
"Other Pay"
AutoCloseDelay=
"3000"
Sticky=
"true"
RelativeTo=
"Element"
EnableShadow=
"false"
EnableEmbeddedSkins=
"false"
Skin=
"KMBlack"
>
</telerik:RadToolTip>
</ItemTemplate>
<HeaderStyle Width=
"8%"
HorizontalAlign=
"Right"
/>
<ItemStyle HorizontalAlign=
"Right"
/>
<FooterStyle HorizontalAlign=
"Right"
/>
</telerik:GridTemplateColumn>
protected
void
grid_CustomAggregate(
object
sender, GridCustomAggregateEventArgs e) {
switch
(e.Column.UniqueName) {
// For some reason adds the string "Custom : " to the footer cell...
case
"OtherPay"
:
e.Result =
string
.Format(
"{0:#,##0}"
, _otherPayTotal);
break
;
}
}
protected
void
gridPayPlanEntries_ItemDataBound(
object
sender, GridItemEventArgs e) {
GridFooterItem footerItem = e.Item
as
GridFooterItem;
// Very strange Telerik issue here. You may ask yourself, why didn't
// we do this as a custom aggregate on the GridTemplateColumn for other
// pay? Well for some reason Telerik was adding the text "Custom : "
// to the cell in the footer with no apparent way to get rid of it.
// Doing it here is kind of a pain, but it works.
if
(footerItem !=
null
) {
footerItem[
"OtherPay"
].Text =
string
.Format(
"{0:#,##0}"
, _otherPayTotal);
return
;
}
}