GridView每页添加不重新开始序号列_[Asp.Net教程]
<%# Container.DataItemIndex+1 %>
每一页从1开始
protected void GV_showAll_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowIndex > -1)
{
e.Row.Cells[0].Text = (e.Row.RowIndex+1).ToString() ;
//或者e.Row.Cells[0].Text = e.Row.DataItemIndex;
}
}
前台模板列为空
或者
<%#Container.DisplayIndex +1%>