total and subtotal in datagrid
-
hello all, I have a Problem i'm showing my total in footer template of datagrid but now i have to display the subtotal just above this footer column or to say within this column but above the total row. hwo can i do this..
Amit Agarwal
-
hello all, I have a Problem i'm showing my total in footer template of datagrid but now i have to display the subtotal just above this footer column or to say within this column but above the total row. hwo can i do this..
Amit Agarwal
the footer of a datagrid is also a datagrid row...so why don't u add another row above the footer and then give the value to specific column...
Koushik
-
hello all, I have a Problem i'm showing my total in footer template of datagrid but now i have to display the subtotal just above this footer column or to say within this column but above the total row. hwo can i do this..
Amit Agarwal
Do you want to get the total in footer Template? on RowDataBound Event of gridview,get values of perticular rows and set footer template.
if (e.Row.RowType == DataControlRowType.DataRow)
{
Totalvalues +=convert.ToInt32(((Lable)e.Rows.Findcontrol("lbl")).Text)
//If you have take Label cotrol
//Totalvalues is global var and assign 0
}
if (e.Row.RowType == DataControlRowType.Footer)
{
((Label)e.Row.FindControl("lblTotal")).Text=Totalvalues.ToString();
}best regard pathan
please don't forget to vote on the post that helped you.