How can I display numbers in the format "###,###.000" within a grid view footer and ItemTemplate?
Footer in HTML :
<FooterTemplate>
<asp:Label ID="totallblCredAmount" runat="server" />
</FooterTemplate>
Footer in code :
if (e.Row.RowType == DataControlRowType.Footer)
{
Label totallblCAmount = (Label)e.Row.FindControl("totallblDebAmount");
totallblCAmount.Text = ViewState["TotalPric"].ToString();
Label totallblCredAmount = (Label)e.Row.FindControl("totallblCredAmount");
totallblCredAmount.Text = ViewState["TotalPrice"].ToString();
}
ItemTemplate HTML :
<asp:TemplateField HeaderText="credit">
<ItemTemplate>
<asp:Label runat="server" Text='<%#(Eval("credit"))%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>