+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to use pager control

How to use pager control

6 posts, 0 answered
  1. michael
    michael avatar
    20 posts
    Registered:
    09 Jan 2009
    23 Jan 2009
    Link to this post
    I've come across this potentially useful control called the Pager.  It is used by many of the Sitefinity modules.

    I am creating a control where I display data in a repeater and I need to page through the data.  I can create my own pagination control but if there is one available (such as the Pager) I would love to use it.

    However, I can't find any examples of how to include the Pager into my control.  I'm hoping that someone can point me at a blog, forum thread or book that would be able to help me understand how to use the Pager control.
  2. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    24 Jan 2009
    Link to this post
    Hi Michael,

    I should start by saying "I don't know".  But I quickly looked into this. 

    The control you're talking about appears to be Telerik.Cms.Web.UI.Pager.  Here it is in action:

    <sf:Pager ID="pager1" runat="server">
        <LayoutTemplate>
             <asp:Repeater ID="PageRepeaterLinkButton" runat="server">
                <HeaderTemplate>
                    <ol class="sf_pager">
                    <li><asp:LinkButton ID="PreviousPage" runat="server" Text="<%$Resources:PreviousPage %>"></asp:LinkButton></li>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:LinkButton ID="SingleItem" runat="server" />
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <li><asp:LinkButton ID="NextPage" runat="server" Text="<%$Resources:NextPage %>"></asp:LinkButton></li>
                    </ol>
                </FooterTemplate>
            </asp:Repeater>
            <asp:Repeater ID="PageRepeaterHyperLink" runat="server">
                <HeaderTemplate>
                    <ol class="sf_pager">
                    <li><asp:HyperLink ID="PreviousPage" runat="server" Text="<%$Resources:PreviousPage %>"></asp:HyperLink></li>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:HyperLink ID="SingleItem" runat="server" />
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <li><asp:HyperLink ID="NextPage" runat="server" Text="<%$Resources:NextPage %>"></asp:HyperLink></li>
                    </ol>
                </FooterTemplate>
            </asp:Repeater>
           
        </LayoutTemplate>
    </sf:Pager>
    From what I can see, this control is looking for 2 very specific contained repeaters.  These repeaters probably need to follow a specific format.  If you emulated this format, it would probably work fine.  I'm not sure what that format is though.

    I'm sure the team will have more information.  Sorry I wasn't able to be more helpful.

    Gabe Sumner
    http://www.sitefinitywatch.com/
  3. Pravat
    Pravat avatar
    59 posts
    Registered:
    22 Jun 2010
    24 Nov 2011
    Link to this post
    Hi Gabe Summer,
                                How can i used this template in 4.2. Please help me....
  4. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    06 Dec 2016
    25 Nov 2011
    Link to this post
    Hello Pravat,

    You can use the out of the box Sitefinity pager control:
    <sf:Pager id="pager" runat="server"></sf:Pager>
    You'll need to register the corresponding TagPrefix:
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    Please do not hesitate to let us know if you need some further information, we'll be glad to help.

    Best wishes,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Pravat
    Pravat avatar
    59 posts
    Registered:
    22 Jun 2010
    25 Nov 2011
    Link to this post
    Hi Boyan Barnev,
                                Thanks for your reply. I have used <sf:Pager id="pager" runat="server"></sf:Pager> and it is working fine. but how can i change the current page css?

    suppose i have 5 page and i have selected third page. now i want to change the third number as selected. how can i change it? please guide me.

    Regards,
    Pravat Sharma
  6. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    06 Dec 2016
    25 Nov 2011
    Link to this post
    Hello Pravat,

    Since Sitefinity 4.3 we are assigning a class sf_PagerCurrent to the current page in the Pager control, if you're using an older version of Sitefinity, can you please try upgrading a copy of your project to the latest officially supported version, and let us know if any problems persist.

    Regards,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
6 posts, 0 answered