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
Apr 19, 2007 13:18
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
Apr 20, 2007 16:38
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
Apr 23, 2007 13:16
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
Apr 23, 2007 16:49
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
Apr 23, 2007 16:51
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
Apr 25, 2007 13:53
* 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.