0

有谁知道如何为在 asp.net c# 的网格视图页脚中显示的计算总值给出逗号?

例如:12,492,323

4

2 回答 2

2
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);
    }
}
于 2012-07-11T05:20:27.810 回答
2

如果没有发布代码,很难准确地回答您的问题。

假设在您后面的代码中计算总数,而不是将总数输入为total.ToString()total.ToString("N0")而是使用。

于 2012-07-11T05:17:08.533 回答