This topic is locked

How to display record number in each row

1/15/2016 4:33:54 PM
ASPRunner.NET Tips and tricks
admin

Here is how this can be done:

  1. Modify SQL query adding a calculated field named 'Rank'

select [ID],

0 as Rank,

[Make],

...

From [Cars]


2. Proceed to 'Fields order and totals' screen, make sure this 'Rank' field appears in the very first column of your grid and set "View as" type to Custom.

Put the following code there:

XSession.Session["Rank"] += 1;

value = XSession.Session["Rank"];


3. Add the following code to List page: BeforeProcess event:

XSession.Session["Rank"]=0;