开发者

how to format the value in currency format in gridview

开发者 https://www.devze.com 2023-02-25 18:13 出处:网络
protected void LineItemGrid_RowDataBound(object sender, GridViewRowEventA开发者_开发百科rgs e)
protected void LineItemGrid_RowDataBound(object sender, GridViewRowEventA开发者_开发百科rgs e)
{
     Label lbl3 = (Label)e.Row.FindControl("lbltotal");
     if (lbl3 != null)
     {
         lbl3.Text = college.Student.Activity[e.Row.RowIndex].Mark1.ToString();
         total += decimal.Parse(lbl3.Text);
     }
}

In the aspx page

<asp:TemplateField HeaderText="Total"  HeaderStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="Right">


The format string is "c".

invoicetransmit.Invoice.LineItem[e.Row.RowIndex].TotalNetAmount.ToString("c");


protected void LineItemGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
     Label lbl3 = (Label)e.Row.FindControl("lbltotal");
     if (lbl3 != null)
     {
         lbl3.Text = college.Student.Activity[e.Row.RowIndex].Mark1.ToString("c");
         total += decimal.Parse(college.Student.Activity[e.Row.RowIndex].Mark1.ToString());
     }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消