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

When using a Data View WebPart to retrieve items from a list, The WebPart shows the results as 1-10, then next page is 11-20 and so on. It does not show whether is it 1-10 of 10 or of 10000.

Is there anyway that I can customize the Data View WebPart to show paging as 1-10 of X for example?

share|improve this question
up vote 0 down vote accepted

There is usually a RowCount variable already defined. If not you can define it like this:

<xsl:variable name="RowCount" select="count($Rows)" />

You can just output that variable where you need to in the xslt.

share|improve this answer
Will this show the TOTAL number of rows overall or just the number of rows in the current page? i.e. if we are having total of 100 records showing up in pages of 10 records, will this variable show 100 or just 10? Also are you using a web service data source or a list as data source? – Emad Jan 18 '10 at 11:23

I have the same issue. But the answer given here will just show the count of the rows currently displayed in the view. Like if we have 10 rows displayed, than the count($Rows) only gives 10. But I want to display like "1-10 Out of 100". How to get the total count ? (I am using Sharepoint dataview webpart.)

share|improve this answer

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.