This is a migrated thread and some comments may be shown as answers.

DataPager not working

5 Answers 109 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Tonyz289
Top achievements
Rank 1
Tonyz289 asked on 23 Aug 2011, 04:50 PM
Here is the design of my page:

I have a TreeView; selecting a node in the view will display a ListView that is filled based on the node.

I also have a search function that displays the ListView filled based on the results of search.

Those functions both work correctly.

My ListView contains a DataPager. The DataPager initializes correctly and matches the contents of the ListView.

My problem is that I can't page. The DataPager itself is changed (page number, etc) but the ListView is static.

RadAjaxManager section
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnRefreshTree">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadTreeView1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadTreeView1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadSlider1" />
                <telerik:AjaxUpdatedControl ControlID="DescriptionText" />
                <telerik:AjaxUpdatedControl ControlID="lblTotalAssets" />
                <telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="RadDataPager1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="btnSelectAll">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="btnUnSelectAll">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="btnRefresh">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadSlider1" />
                <telerik:AjaxUpdatedControl ControlID="lblTotalAssets" />
                <telerik:AjaxUpdatedControl ControlID="RadListView1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadListView1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadTreeView1" />
                <telerik:AjaxUpdatedControl ControlID="RadSlider1" />
                <telerik:AjaxUpdatedControl ControlID="DescriptionText" />
                <telerik:AjaxUpdatedControl ControlID="lblTotalAssets" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadDataPager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadSlider1" />
                <telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

ListView and DataPager section:
<telerik:RadListView ID="RadListView1" runat="server" AllowPaging="True" ItemPlaceholderID="PlaceHolder1"
    OnItemCreated="RadListView1_ItemCreated" OnPreRender="RadListView1_PreRender"
    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" Target="_new" NavigateUrl="assetinfo.aspx" runat="server"><%# Eval("filename") %></asp:HyperLink>--%>
                <asp:HiddenField ID="hiddenAssetId" Value='<%# Eval("id") %>' runat="server" />
            </div>
        </div>
    </ItemTemplate>
    <EmptyDataTemplate>
        No Assets Found
    </EmptyDataTemplate>
</telerik:RadListView>

5 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 26 Aug 2011, 02:05 PM
Hello Tony,

Could you please let me know if the application works correctly when the Ajax is disabled on the page.
Also I would suggest you to review the following online demo which provides approach for using RadDataPager with RadListView.

Greetings,
Maria Ilieva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Tonyz289
Top achievements
Rank 1
answered on 26 Aug 2011, 02:33 PM
Under Telerik how do I disable the Ajax is on the page.?
0
Maria Ilieva
Telerik team
answered on 29 Aug 2011, 08:43 AM
Hello Tony,

Please set the EnableAjax property of the RadAjaxManager order to "disabled" in order to disable the Ajax on the page.

Regards,
Maria Ilieva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Tonyz289
Top achievements
Rank 1
answered on 30 Aug 2011, 02:24 PM
The only thing that occurs is my ListView no longer appears. Everything else is non-working.
0
Maria Ilieva
Telerik team
answered on 01 Sep 2011, 12:29 PM
Hello Tony,

It will be best if you open a regular support ticket and send us runnable version of your application. Thus we will be bale to debug it locally and od our best to isolate the root cause of the problem and provide proper solution for your scenario.

Greetings,
Maria Ilieva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
DataPager
Asked by
Tonyz289
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Tonyz289
Top achievements
Rank 1
Share this question
or