Forums: How to display record number in each row - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to display record number in each row

#1 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16045
  • Joined: 03-February 03

Posted 15 January 2016 - 09:33 PM

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;

Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic