SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom list and i would like to have a row number. I did use the <xsl:number/>and that worked but when i click on the next page of the list the number resets itself back to 1 again. Is there a way to have the row number continue when paging. Thanks in advance

share|improve this question

Why not try the position() function (if you look within the XSLT generated for a DataView or XSLTView you would still find it there) as it is already used for the FirstRow/LastRow combinations, as well as Conditional Formatting routines, e.g.

<xsl:if test="position() mod 2 = 1">


share|improve this answer

If the xml you are transforming only contains the data to be displayed on a single page, rather than the complete set, then the XSL has no way of knowing the row number in the context of the complete set. You then become responsible for calculating it.

You probably know the page size and page index as you are managing the paging. You could pass these values into the transformation as arguments.

dataset row index = (page size * page index) + page row index
share|improve this answer
thanks guys.I would have to come with a xsl to do that then was wandering if anyone dome similar before – naijacoder Aug 28 '12 at 8:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.