Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Unable to paging in XSLTListViewWebPart programmatically.

$
0
0

I want to display the document library's view on the page. To do so, I am using XsltListViewWebpart.

My code is:

	XsltListViewWebPart documentView = new XsltListViewWebPart();
	documentView.ListId = documentLibrary.ID;
	SPView view = documentLibrary.DefaultView;
	documentView.Toolbar = "";
	StringBuilder xml = new StringBuilder();
	xml.Append("<View Name='" + documentLibrary.DefaultView.ID.ToString("B").ToString().ToUpper(CultureInfo.InvariantCulture) + "' TabularView='FALSE' MobileView='TRUE' Type='HTML'  Hidden='TRUE' DisplayName=''  Level='1' BaseViewID='1' ContentTypeID='0x' ImageUrl='/_layouts/images/generic.png'>");

	xml.Append("<Query><OrderBy><FieldRef Name='ID'/></OrderBy></Query>");                            

	xml.Append("<RowLimit Paged='TRUE'>10</RowLimit>");

	xml.Append("<Aggregations Value='Off'/>");

	xml.Append("<Toolbar Type='None'/></View>");

	documentView.XmlDefinition = xml.ToString();
	documentView.AllowClose = true;
	documentView.AllowConnect = true;
	documentView.AllowEdit = true;
	documentView.AllowHide = true;
	documentView.AllowMinimize = true;
	documentView.AllowZoneChange = true;
	documentView.ChromeType = PartChromeType.TitleOnly;
	documentView.ID = taskWebPartId;
	wpmgr.AddWebPart(documentView, "wpz", 3);

After executing above code web part gets added but the paging is not applied.

To do paging, I have referred (This) link.

What am I missing?



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>