A method of displaying the serial number in each row in the DataGrid of ASP.NET

xiaoxiao2021-03-06  102

In DataGrid, the serial number is added to each line, and 1, 2, 3 is displayed from the first row ...

You can add a template column in the DataGrid, then add the following code:

<% # (Container.ItemIndex 1) DataGrid1.currentpageIndex * DataGrid1.pageSize%>

Also, if your DataGrid has no paging, this is ok:

<% # Container.Index 1%>

转载请注明原文地址:https://www.9cbs.com/read-126816.html

New Post(0)