I'm working on SharePoint 2007. On adding Pagination in the Data View Web Part, by default it shows something like '1-10'. ie the numnber of documents dispalyed. I wish to replace this with exact page number such as '1|2|3|4....' so that the User can directly navigate to any particular Page. I tried to edit the XSLT by following this link: http://blogs.msdn.com/b/cjwalker/archive/2005/05/28/422826.aspx
Steps I followed:
- Find
<xsl:template name="dvt_1.navigation">
and add<xsl:param name="Rows"/>
as the last param Somewhere in the that is output in this template
<tr><td colspan="2" class="ms-vb"> <xsl:for-each select="$Rows"> <xsl:if test="(position() mod $RowLimit) = 1"> <a> <xsl:attribute name="href">javascript: <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={',position(),'}'))"/>;</xsl:attribute> <xsl:value-of select="((position() - 1) div $RowLimit) + 1"/></a> <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&nbsp;</xsl:text> </xsl:if> </xsl:for-each> </td></tr>
Find
<xsl:call-template name="dvt_1.navigation">
and add<xsl:with-param name="Rows" select="$Rows"/>
as the last param.
I followed exact steps but but it shows error that the webpart cant be rendered. Can any body tell me whats missing in this code.
Thanks in Advance