PagingControl Sample

Vote:
 
Hi! Does anyone have some sample code that shows how to use the PagingControl together with a NewsList or a PageSearch? I want to customize the position and style of the paging links. /Jonas
#13015
Mar 25, 2008 18:35
Vote:
 
Hi. A short example on the basic logic: In markup: ... In Codebehind: EPiServer.WebControls.PagingControl customPaging = new EPiServer.WebControls.PagingControl(); customPaging.NextPagingItemText = "Next"; customPaging.PrevPagingItemText = "Previous"; myList.PagingControl = customPaging; myList.DataBind(); See the SDK for all available PagingControl properties.
#15252
Mar 25, 2008 18:46
Vote:
 
Yes, now it works... But how can i access the total number of objects in my NewsList or PageSearch list when paging is activated? I want to show a text like "10 of total 56 pages", DataCount of the list is only returning the number of objects in current paging. /Jonas
#15253
Mar 25, 2008 18:46
Vote:
 
In order to do this you need two PageSearch controls, one for the total amount of results and one for the paged amount, like this:
#15254
Mar 25, 2008 18:46
Vote:
 
I forgot to close the last PageSearch control and insert the templated controls, but I think you get the idea. The SearchViewer is the one that displays the results. Don't forgot to bind the data.
#15255
Mar 25, 2008 18:46
Vote:
 
I found a better way :-) Use the Count property of the e.Pages collection in the filter event to recieve the total amount of items when paging is activated. /Jonas
#15256
Mar 25, 2008 18:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.