Google Search

Google
 
Showing posts with label Serial No to Datagrid. Show all posts
Showing posts with label Serial No to Datagrid. Show all posts

Thursday, June 5, 2008

Add a Serial No column to DataGrid

protected int i = 1;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Text = Convert.ToString(GridView1.PageIndex * GridView1.PageSize + i);
i++;
}

}