Hi,
I have taken on Label Control to display Margin. I can do grand total but I am not able to do total when it group by.
<telerik:GridTemplateColumn AllowFiltering="false" HeaderText="HGU Margin %" SortExpression="HGUMargin"
UniqueName="HGUMargin" ColumnEditorID="HGUMarginEditor">
<ItemTemplate>
<asp:Label ID="lblHGUMargin" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "HGUMargin", "{0:P2}")%>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label runat="server" Text="test" ID="lblforHGUMargin"></asp:Label>
</FooterTemplate>
<FooterStyle Width="50px" />
</telerik:GridTemplateColumn>
On Code behind I am trying to display margin like this:
if (e.Item.ItemType == GridItemType.GroupFooter)
{
GridGroupFooterItem itemGroupFooter = e.Item as GridGroupFooterItem;
(itemGroupFooter["HGUMargin"].FindControl("lblforHGUMargin") as Label).Text = hgusp.ToString("00.00") + "%";
}
It gives me null label.
My question is How to find label control in code behind or client id of label when I do group by.
Thanks,
Mona
I have taken on Label Control to display Margin. I can do grand total but I am not able to do total when it group by.
<telerik:GridTemplateColumn AllowFiltering="false" HeaderText="HGU Margin %" SortExpression="HGUMargin"
UniqueName="HGUMargin" ColumnEditorID="HGUMarginEditor">
<ItemTemplate>
<asp:Label ID="lblHGUMargin" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "HGUMargin", "{0:P2}")%>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label runat="server" Text="test" ID="lblforHGUMargin"></asp:Label>
</FooterTemplate>
<FooterStyle Width="50px" />
</telerik:GridTemplateColumn>
On Code behind I am trying to display margin like this:
if (e.Item.ItemType == GridItemType.GroupFooter)
{
GridGroupFooterItem itemGroupFooter = e.Item as GridGroupFooterItem;
(itemGroupFooter["HGUMargin"].FindControl("lblforHGUMargin") as Label).Text = hgusp.ToString("00.00") + "%";
}
It gives me null label.
My question is How to find label control in code behind or client id of label when I do group by.
Thanks,
Mona