I have a listview webpart. I want to apply a custom xslt to it. I am able to apply a custom xslt to the listview webpart, however I am not able to find a xslt code to support "paging" in the xslt for the webpart. Please bail me out.
Thanks in Advance
I have configured the underlying view to show 20 items at a time. But my custom xslt is applied only on the first 20 items, as I am unable to get the xslt code to support paging. can you provide me a xslt code to support paging using my xslt.
Appreciate your response.
I recently encountered this exact issue. I was using SharePoint Designer to help me create custom XSLT which I then brought back into my Visual Studio solution so that I could permanantly associate a certain type of rendering with a given list.
You likely don't need any special additional XSL to make paging work, but, you might have a missing or mal-formed xsl:param that is reponsible for grabbing records that the paging xsl template would eventually need to have passed into it. In my scenario, the custom rendering was working, but, I could only see the first page of records even though I knew there were more.
In the following code block, I'll paste the *bad* code that I had in my XSL file initially. The last xsl:param, "AllRows", is what is responsible for the paging (or, better stated, the AllRows param determines the records available for paging).. and it is mal-formed in this snippet
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal" xmlns:o="urn:schemas-microsoft-com:office:office"> <xsl:include href="/_layouts/xsl/main.xsl"/> <xsl:include href="/_layouts/xsl/internal.xsl"/> <xsl:param name="AllRows" select="/dsQueryResponse/Rows/Row[(position() >= $FirstRow and position() <= $LastRow)]"/>
... truncated out the meat of my xsl customizations ....
I think it has something to do with the WYSIWYG functionalities in SPD. Again, this is just a guess, but, I think because during development I had tried to custom design a list with only 2 or 3 items in it. Thus, the paging XSL code isn't shown properly in SharePoint Designer's code view since no paging was necessary in the design view. Instead, I had to put a bunch of bogus rows in my list, so that by the time I went into SharePoint Designer it would render the correct paging code.
So, in the above XSL template, delete the xsl:param AllRows node, and replace it with this one instead:
<xsl:param name="AllRows" select="/dsQueryResponse/Rows/Row[$EntityName = '' or (position() >= $FirstRow and position() <= $LastRow)]"/>