Navigation with a RadDataPager not working

2 posts, 0 answers
  1. Tonyz289
    Tonyz289  avatar
    50 posts
    Member since:
    Jun 2011

    Posted 03 Nov 2011 Link to this post

    I have the Listview with a RadDataPager included  in it, When the Listview is populated the RadDataPager elements are correct. Howvere the second I click on any of the navigation buttons the ListView does not display the correct data. What is happening?

    Listview definition with RadDataPager bolded:
    <telerik:RadListView ID="RadListView1" runat="server" AllowPaging="True" ItemPlaceholderID="PlaceHolder1"
        OnItemCreated="RadListView1_ItemCreated"
        DataKeyNames="id">
        <LayoutTemplate>
            <div class="RadListView RadListViewFloated RadListView_Windows7">
                <telerik:RadDataPager ID="RadDataPager1" runat="server" Skin="Sitefinity" PageSize="25"
                    PagedControlID="RadListView1" BorderWidth="0">
                    <Fields>
                        <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                        <telerik:RadDataPagerButtonField FieldType="Numeric" />
                        <telerik:RadDataPagerButtonField FieldType="NextLast" />
                        <telerik:RadDataPagerPageSizeField PageSizeText="Page size: " />
                        <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go"
                            TextBoxWidth="15" />
                        <telerik:RadDataPagerTemplatePageField>
                            <PagerTemplate>
                                <div style="float: right">
                                    <b>Items
                                        <asp:Label runat="server" ID="CurrentPageLabel" Text="<%# Container.Owner.StartRowIndex + 1%>" />
                                        to
                                        <asp:Label runat="server" ID="TotalPagesLabel" Text="<%# Container.Owner.StartRowIndex+Container.Owner.PageSize %>" />
                                        of
                                        <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>" />
                                        <br />
                                    </b>
                                </div>
                            </PagerTemplate>
                        </telerik:RadDataPagerTemplatePageField>
                    </Fields>
                </telerik:RadDataPager>
                <div id="PlaceHolder1" runat="server" />
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <div style="float: left;">
                <fieldset style="border: 0; width: 154px; height: 154px; margin: 5px 5px 5px 5px;">
                    <div class="myClass" style="padding: 2px 2px 2px 2px; background: #eeeeee; text-align: center;">
                        <a href="javascript:Popup_Window('asset_preview','<%# Eval("id") %>')">
                            <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AutoAdjustImageControlSize="False"
                                CssClass="myClass" ImageUrl='<%# Eval("thumbUrl") %>' ResizeMode="Fit" AlternateText="Click to view preview"
                                ToolTip="Click to view preview" Width="150px" Height="150px" />
                        </a>
                    </div>
                </fieldset>
                <div style="border: 0px; white-space: normal; width: 150px; margin: 5px 5px 5px 5px;
                    padding: 2px 2px 2px 2px;">
                    <asp:CheckBox ID="chkImage" runat="server" AutoPostBack="True" />
                    <%--<a href="javascript:Popup_Window('asset_detail','<%# Eval("id") %>')">
                                        <%# Eval("title") %>-<%# Eval("filenameextension") %></a>--%>
                    <asp:HyperLink ID="lnkAsset" runat="server">
                                        <%# Eval("title") %>-<%# Eval("filenameextension") %></asp:HyperLink>
                    <asp:HiddenField ID="hiddenAssetId" Value='<%# Eval("id") %>' runat="server" />
                </div>
            </div>
        </ItemTemplate>
        <EmptyDataTemplate>
            No Assets Found
        </EmptyDataTemplate>
    </telerik:RadListView>
  2. Tonyz289
    Tonyz289  avatar
    50 posts
    Member since:
    Jun 2011

    Posted 04 Nov 2011 Link to this post

    Fixed. I needed to used the OnNeedDataSource event.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top