how to add custom repeater and unipager

Khathun s asked on February 3, 2018 05:11

Hi Team, I have added a custom repeater with header and content in a transformation, and added cms unipager for pagination but data is displaying properly but pagination is not working please help me. and my code

<cms:CMSRepeater ID="listingRepeater" runat="server" PagerControl-CssClass="table table-striped" Path="/%"  DelayedLoading="true" OrderBy="NodeLevel, NodeOrder" DataBindByDefault="false" EnablePaging="true">
    <cms:UniPager ID="listingUniPager" runat="server" PageControl="listingRepeater" PageSize="4" GroupSize="4" PagerMode="PostBack">
            <a href="<%# Eval("ID") %>"><%# Eval("ID") %></a>

and my code behind

    listingRepeater.DataSource = results;
    listingRepeater.EnablePaging = true;
    listingRepeater.UniPagerControl = listingUniPager;

Recent Answers

Trevor Fayas answered on February 5, 2018 15:25

I think your issue is you are setting the "PageControl" property of the Universal Viewer, but really this should be the "TargetControlName" (although this may depend on your version of Kentico, what version are you on?)

Another possibility is you may need to rebind the Pager after the listing is bound, so the pager re-loads with the proper data.

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on February 5, 2018 20:12

It is hard to guess. You should look in Kentico files for similar situation. Most likely you are missing some settings. Like this one: listingUniPager.PagedControl = listingRepeater;

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.