Thursday, July 19, 2007

ASP GridView: Displaying the Summary Data in the Footer

It is many times necessary to display some additional data in the GridView's footer row. This task can be accomplished through the RowDataBound event handler.

protected void Gridview_RowDataBound(object sender, GridViewRowEventArgs e)
{
         if (e.Row.RowType == DataControlRowType.Footer) //if the row is footer
         {
                e.Row.Cells[3].Text = "Some text" ;
         }
}

del.icio.us Tags: ,,,