Wednesday, August 8, 2012

DataView Asynchronous Paging issue

I faced problem when tried to use paging with DataView. Because DataView use history.back(); for previous link. It doesn't work correct.
I found  blog solved this problem:

Open the code view and search for a that has a class named “ms-paging” and then paste those lines before the starting of the td tag:

<xsl:variable name="dvt_PrevPageData">
<xsl:when test="($FirstRow - $RowLimit - 1) > -1">
<xsl:value-of select="$FirstRow - $RowLimit - 1" />

Search for “history.back()” and then replace the line with that line:
<xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={',$PrevRow,'};dvt_startposition={Paged=TRUE&p_ID=',$dvt_PrevPageData,'}'))" />;</xsl:attribute>

To make sure this solution work correct RowLimit must equal pagesize