Reputation:
Do anyone know how to give comma for the calculated total value displaying in grid view Footer in asp.net c#?
Eg:12,492,323
Upvotes: 0
Views: 1032
Reputation: 2624
Without code posted, it is hard to answer your question precisely.
Assuming in your code behind you calculate the total, instead of putting in the total as total.ToString()
, use total.ToString("N0")
instead.
Upvotes: 2
Reputation: 24302
protected void grdList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
Label lbl = (Label)(e.Row.FindControl("lblTotal"));
lbl.Text = String.Format("{0:n}", Total);
}
}
Upvotes: 2