I've build a Data View Web Part with SharePoint Designer 2010, using SPDataSource and DataSourceMode="CrossList". The DVWP works great, but when I add paging, it adds the paging placeholder and the pager on the page with all the templates in the XSL, but it's not working, either the rowlimit on this DVWP is not working.

What can I do?

Please assist, Thanks!

2 Answers 2


This is in fact possible with the OOTB paging. I found the solution by accident while working on a CrossList DVWP. The origin to the problem is changes that are made to several variables in the DVWP, probably by SPD when turning it into CrossList mode.

An Easy way to get the paging working again is by adding the Grouping toolbar to the dataview from the Options Toolbar icon under the Design tab in SPD. This will do the necessary changes and the paging will still work even if you remove the toolbar.

Furthermore, I've examined the code and these are the changes between the none-working and the working code:

1. In dvt_1 template, change the LastRow variable to:

<xsl:variable name="LastRow" >
    <xsl:when test="($FirstRow + $RowLimit - 1) &gt; $dvt_RowCount"><xsl:value-of select="$dvt_RowCount" /></xsl:when>
    <xsl:otherwise><xsl:value-of select="$FirstRow + $RowLimit - 1" /></xsl:otherwise>

2. Still within dvt_1, in the call to dvt1.body, change the Row parameter to:

<xsl:with-param name="Rows" select="$Rows[position() &gt;= $FirstRow and position() &lt;= $LastRow]" />

3. In dvt.CommandFooter, change the test attribute of the first xsl:if tag to:

<xsl:if test="$FirstRow &gt; 1 or $LastRow &lt; $dvt_RowCount">

4. In the SPDatasource Tag, delete the asp:parameters under the SelectParameters tag (StartRowIndex, nextpagedata and MaximumRows)


The out of the box paging won't work with a CrossList DVWP. You'll need to come up with a different scheme. I usually do something with script so that the action is all on the client side. If you have a very large number of items that may be prohibitive due to the large page load, but otherwise, it's mouch better UX.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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