hi friends
I am pasting my code here I want to sum of total CountDevice in footer of template
int total = 0;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
total += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "CountDevice"));
}
if (e.Row.RowType == DataControlRowType.Footer)
{
Label lblamount = (Label)e.Row.FindControl("lblTotal");
lblamount.Text = "total:" + total.ToString();
}
}
i am use sorting on column CountDevice
when sorting this column show double column in footer
for Example total countdevice is 100
when sorting on column CountDevice total show 200