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

DataPager with RadListView

2 Answers 7 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Disposable Hero
Top achievements
Rank 1
Disposable Hero asked on 24 Jun 2019, 02:36 PM

Hello, I'm having a problem where the DataPager won't work if my RadListView has more than approximate 1,800 records. Everything is fine with small record counts returned in sql. Is something wrong with my Panels or AjaxManager? Please advise. 

 

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings> 

                    <telerik:AjaxSetting AjaxControlID="ListViewPanel1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="ListViewPanel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="RadDataPager1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>

                  <telerik:AjaxSetting AjaxControlID="RadDataPager1">
                        <UpdatedControls>                     
                            <telerik:AjaxUpdatedControl ControlID="ListViewPanel1" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelHeight="100%" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>

            </telerik:RadAjaxManager>

            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="30"></telerik:RadAjaxLoadingPanel>
            <div class="demo-container position-relative" style="height: 65%;"

 

                <div id="demo" class="demo-container no-bg page-wrapper position-relative scroll_vertical height-55percent">
                    <asp:Panel ID="ListViewPanel1" runat="server" Width="100%" Height="50%" CssClass="position-relative height-100percent">
                        <telerik:RadListView
                            ID="RadListView1"
                            runat="server"
                            RenderMode="Lightweight"
                            ItemPlaceholderID="ProductsHolder"
                            OnItemDataBound="RadListView1_ItemDataBound"
                          DataKeyNames="ENTITY_ID,CLAIM_TRANSACTION_SUMMARY_ID,ACTIVITY_NOTES,AGE,COLLECTION_DAYS,LAST_ACTIVITY_DATE,INACTIVE_DATE,FORM_TYPE,FLCOLOR,INCOLOR"
                            AllowPaging="true"
                            AllowCustomPaging="true"
                            CssClass="position-relative height-100percent"
                            OnItemCommand="RadListView1_ItemCommand" Width="100%" Height="100%">
                            <LayoutTemplate>
                                <div class="RadListView position-relative height-100percent" style="height: 100%;">
                                    <asp:Panel ID="ProductsHolder" runat="server" />
                                </div>
                            </LayoutTemplate>
                            <ItemTemplate>.....

                            </ItemTemplate>
                            <EmptyDataTemplate>
                                <fieldset class="noRecordsFieldset">
                                    No records for available.
                                </fieldset>
                            </EmptyDataTemplate>
                        </telerik:RadListView>

                 </asp:Panel>
                </div>

 

  <!-- Pagination -->
                <div class="claims-pagination">
                    <fieldset style="border-width: 1px; border-color: #E6E6E6;">
                        <div>
                            <telerik:RadDataPager RenderMode="Lightweight" ID="RadDataPager1" runat="server" PagedControlID="RadListView1" PageSize="50">
                                <Fields>
                                    <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                                    <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="5" />
                                    <telerik:RadDataPagerButtonField FieldType="NextLast" />
                                    <telerik:RadDataPagerPageSizeField PageSizeComboWidth="60" PageSizeText="Page size: " />
                                    <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go" />
                                    <telerik:RadDataPagerTemplatePageField>
                                        <PagerTemplate>
                                            <div class="pager">
                                                <b>Items<asp:Label runat="server" ID="CurrentPageLabel" Text="<%# Container.Owner.StartRowIndex + 1%>" />
                                                    to
                                             <asp:Label runat="server" ID="TotalPagesLabel" Text="<%# If(Container.Owner.TotalRowCount > (Container.Owner.StartRowIndex + Container.Owner.PageSize), Container.Owner.StartRowIndex + Container.Owner.PageSize, Container.Owner.TotalRowCount) %>" />
                                                    of
                                                        <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>" />
                                                    <br />
                                                </b>
                                            </div>
                                        </PagerTemplate>
                                    </telerik:RadDataPagerTemplatePageField>
                                </Fields>
                            </telerik:RadDataPager>
                        </div>
                    </fieldset>
                </div>

 

 

Code behind:

    Protected Sub RadListView1_NeedDataSource(source As Object, e As Telerik.Web.UI.RadListViewNeedDataSourceEventArgs) Handles RadListView1.NeedDataSource
        Try
            iMinRows = (RadListView1.CurrentPageIndex * RadListView1.PageSize)
            iMaxRows = ((RadListView1.CurrentPageIndex + 1) * RadListView1.PageSize)

            If Not IsNothing(dtClaims) Then
                dtClaims.Clear()
            End If

            dtClaims = ucFilters.GetDataTablePage(iMinRows, iMaxRows)

            RadListView1.DataSource = dtClaims
            RadListView1.VirtualItemCount = ucFilters.RowCount
        Catch ex As Exception
            Throw ex
        End Try
    End Sub

2 Answers, 1 is accepted

Sort by
0
Disposable Hero
Top achievements
Rank 1
answered on 24 Jun 2019, 09:15 PM

Resolved. It was a max string limit on the query which I resolved with this web.config maxRequestLength entry. 

<httpRuntime requestValidationMode="2.0" targetFramework="4.5.1" maxRequestLength="51200"/>

0
Rumen
Telerik team
answered on 25 Jun 2019, 06:08 AM
Hi Christopher,

It is great that you've managed to fix the problem! Thank you for sharing the solution too!

Can you please tell us what the error message was so that everyone who experiences it in the future can find easier this forum? 

Thank you!

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DataPager
Asked by
Disposable Hero
Top achievements
Rank 1
Answers by
Disposable Hero
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or