Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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!

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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:choose>
    <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>
</xsl:choose>
</xsl:variable>

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)

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

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.