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());
}
}
精彩评论