GridView专栏

时间:2022-11-17 03:47:55

鉴于GridView的强大,鄙人突然心血来潮,想把GridView单独拿出来整理一下。

(一)gridview如何加自增长列

 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowIndex != -)
{
int indexID = this.GridView1.PageIndex * this.GridView1.PageSize + e.Row.RowIndex + ;
e.Row.Cells[].Text = indexID.ToString();
}
}