private decimal sum = 0;
protected
void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
sum = sum + Convert.ToDecimal(e.Row.Cells[2].Text);
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[1].Text = “Total Rs”;
//e.Row.Cells[2].Text = sum.ToString(“c”, new CultureInfo(“hi-IN”));
e.Row.Cells[2].Text = sum.ToString();
e.Row.Font.Bold = true;
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
sum = sum + Convert.ToDecimal(e.Row.Cells[2].Text);
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[1].Text = “Total Rs”;
//e.Row.Cells[2].Text = sum.ToString(“c”, new CultureInfo(“hi-IN”));
e.Row.Cells[2].Text = sum.ToString();
e.Row.Font.Bold = true;
}
}
No comments:
Post a Comment