How to display sum of particular column in GridView Footer.
The following code sample shows how to display text in GridView Footer.
Stpes:
1) Set GridView ShowFooter property to true;
2) Write the below code in GridView_RowdataBound Event
if ( e.Row.RowType == DataControlRowType.DataRow )
sum = sum + Convert.ToInt32 ( e.Row.Cells [ 0 ].Text );
else if ( e.Row.RowType == DataControlRowType.Footer )
e.Row.Cells [ 0 ].Text = sum.ToString ( "c" );
Thats it...
Very good and useful code