给GridView列表的每一行加序号。
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{ if (e.Row.RowIndex >= 0)
{
e.Row.Cells[0].Text = Convert.ToString(e.Row.DataItemIndex + 1);
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{ if (e.Row.RowIndex >= 0)
{
e.Row.Cells[0].Text = Convert.ToString(e.Row.DataItemIndex + 1);
}
}

浙公网安备 33010602011771号