Hi Please use following code
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
TableCell tCell = new TableCell();
Image img = new Image();
img.ImageUrl = "subheader.jpg";
tCell.Controls.Add(img);
GridView gView = (GridView)sender;
int colSpan = gView.Columns.Count;
tCell.Attributes["ColSpan"] = colSpan.ToString();
GridViewRow gRow = new GridViewRow(-1, -1, DataControlRowType.DataRow, DataControlRowState.Normal);
gRow.Cells.Add(tCell);
Table tbl = (Table)e.Row.Parent;
if(pgSize == 0)
pgSize = GridView1.PageCount / 2;
if (Convert.ToDouble(e.Row.DataItemIndex + 1) / Convert.ToDouble(pgSize) == 1.0)
{
tbl.Controls.AddAt(gView.Controls[0].Controls.Count, gRow);
pgSize = pgSize + 10;
}
}
}
Regards
Sujeet