Multiple Pager Controls - one on top one on bottom of list
I'm trying to put the pager control for a list of news items on both the top and the bottom. It appears it only picks up a pager if the id=pager so I only get the first one rendered. Is there a way to do something like this? Below is my template code.
<
sf:Pager
id
=
"pager"
runat
=
"server"
></
sf:Pager
>
... news items ...
<
sf:Pager
id
=
"pager2"
runat
=
"server"
></
sf:Pager
>
Hi,
The MasterListView for News is configuring a Pager with exactly this ID - "pager". To configure another Pager you will have to replace the MasterListView with a custom class that does the job.
Create a class like this in your SitefinityWebApp:
namespace
SitefinityWebApp
public
class
CustomMasterListView : Telerik.Sitefinity.Modules.News.Web.UI.MasterListView
protected
override
void
InitializeListView(IQueryable<Telerik.Sitefinity.News.Model.NewsItem> query,
int
? totalCount)
base
.InitializeListView(query, totalCount);
if
(totalCount.HasValue && totalCount.Value != 0)
var pager2 =
this
.Container.GetControl<Pager>(
"pager2"
,
false
);
if
(pager2 !=
null
)
this
.ConfigurePager(pager2, totalCount.Value);
I realize this is an old thread, but didn't appear to work for me.
The ViewType in admin didn't match what you said, and it doesnt seem to be saving it if I add customMasterListView to the field...
Telerik.Sitefinity.Modules.News.Web.UI.MasterListView, Telerik.Sitefinity.ContentModules
Using v7.2.53
Hello Nik,
I have answer you in the support ticket.
Once you have the solution you can share it with the community.
Regards,
Svetoslav Manchev
Telerik
Turns out it didn't like me adding the viewtype to what was there. Once I cleared the ViewType field and pasted in SitefinityWebApp.Custom.CustomMasterListView, it saved and started working.