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

Forums / Developing with Sitefinity / Document List Pagination Issue

Document List Pagination Issue

2 posts, 0 answered
  1. martin
    martin avatar
    36 posts
    Registered:
    30 Nov 2008
    19 Apr 2010
    Link to this post

    Hi,

    I'm using a custom template to show downloadable documents. I have set up pagination on the page and it works fine. When I try to change the order in which the previous and next link buttons appear, it stops working.

    Basically I am trying to get he previous button after page numbers. It works fine when Its before the numbers.

     

    <telerik:Pager ID="pager1" runat="server">
        <LayoutTemplate>
             <asp:Repeater ID="PageRepeaterLinkButton" runat="server">
                <HeaderTemplate>
                    <ol class="sf_pager">
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:LinkButton ID="SingleItem" runat="server" />
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <li><asp:LinkButton  ID="PreviousPage" 
                                                                                        runat="server" 
                                                                                        Text="Previous">
                                </
    asp:LinkButton>
                          </
    li>
                    <li>
                                <
    asp:LinkButton  ID="NextPage" 
                                                runat="server" 
                                                Text="Next">
                                </
    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="Previous"></asp:HyperLink></li>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:HyperLink ID="SingleItem" runat="server" />
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <li><asp:HyperLink ID="NextPage" 
                                                                                      runat="server" 
                                                                                      Text="Next">
                              </
    asp:HyperLink>
                            </
    li>
                    </ol>
                </FooterTemplate>
            </asp:Repeater>
        </LayoutTemplate>
    </telerik:Pager>


    Thanks
    Kieran
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 Apr 2010
    Link to this post
    Hello martin,

    Thank you for using our services.

    Unfortunately this cannot be done with the implementation of the pager control, as it is looking for the previous page link in the header of the respective repeater. In order to achieve this you will have to create a custom pager. Then you would have to override CreateChildControls method in order to substitute the biniding logic with yours and make the repeaters look for the previous page link in their footers. Attached you can find a sample of this control. In order to use it, register it in the control template you are editing:
    <%@ Register Assembly="App_Code" Namespace="Sitefinity.Samples.WebControls" TagPrefix="sfWeb" %>

    Then substitute the original pager with the custom one:
    <sfWeb:CustomPager 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:Gallery_PreviousPage %>"></asp:LinkButton></li>--%>
        </HeaderTemplate>
        <ItemTemplate>
        <li>
        <asp:LinkButton ID="SingleItem" runat="server" />
        </li>
        </ItemTemplate>
        <FooterTemplate>
        <li><asp:LinkButton ID="PreviousPage" runat="server" Text="<%$Resources:Gallery_PreviousPage %>"></asp:LinkButton></li>
        <li><asp:LinkButton ID="NextPage" runat="server" Text="<%$Resources:Gallery_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:Gallery_PreviousPage %>"></asp:HyperLink></li>--%>
        </HeaderTemplate>
        <ItemTemplate>
        <li>
        <asp:HyperLink ID="SingleItem" runat="server" />
        </li>
        </ItemTemplate>
        <FooterTemplate>
        <li><asp:HyperLink ID="PreviousPage" runat="server" Text="<%$Resources:Gallery_PreviousPage %>"></asp:HyperLink></li>
        <li><asp:HyperLink ID="NextPage" runat="server" Text="<%$Resources:Gallery_NextPage %>"></asp:HyperLink></li>
        </ol>
        </FooterTemplate>
        </asp:Repeater>
        </LayoutTemplate>
    </sfWeb:CustomPager>



    Regards,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 0 answered