There are two ways you can generate sequence number in grid.
1. Generate Sequence Number in Datagrid from aspx page you can simply add:
2. Generate Sequence Number in Datagrid from SQL:
1. Generate Sequence Number in Datagrid from aspx page you can simply add:
<%# (DataGrid1.PageSize*DataGrid1.CurrentPageIndex)+ Container.ItemIndex+1%>
2. Generate Sequence Number in Datagrid from SQL:
SELECT ROW_NUMBER() OVER(ORDER BY ID DESC) AS SeqNumber FROM TABLE_NAME
AND Bind DataGrid as,
<%#DataBinder.Eval(Container.DataItem,"SeqNumber")%>
1 comment:
Thanks your post is very helpful
Post a Comment