Trouble with RadGrid Virtualization AND Custom Paging

4 posts, 0 answers
  1. Dan
    Dan avatar
    1 posts
    Member since:
    Aug 2012

    Posted 27 Jan 2014 Link to this post

    I am trying to get a RadGrid to support both Virtualization and Custom Paging.  I can get either to work fine, but not both together.  This is my code for NeedDataSource below.  It seems that CurrentPageIndex  is always set to 0.  I would expect that to increment with the virtual scrolling.

      protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
            {
                
                int startRowIndex = RadGrid1.CurrentPageIndex * RadGrid1.PageSize;
                int maxRows = RadGrid1.PageSize;
                var reportDetails = DataAccess.GetReportDetails(Convert.ToInt32(reportSummary["ReportSummaryId"]), startRowIndex, maxRows);
                RadGrid1.DataSource = reportDetails;
            }

            protected void RadAjaxPanel_Init(object sender, EventArgs e)
            {
                //SET THE TOTAL # OF ROWS IN THE OVERALL REPORT
                string userKey = Common.GetUserKeyFromCookie(Request);
                DataTable reportSummaryTable = DataAccess.GetReportSummary(userKey, "SelectFollows");
                reportSummary = reportSummaryTable.Rows[0];
                int recordCount = Convert.ToInt32(reportSummary["RecordCount"]);
                RadGrid1.MasterTableView.VirtualItemCount = recordCount;
                RadGrid1.VirtualItemCount = recordCount;
            }



    The code from my ASPX is:

    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel" OnInit="RadAjaxPanel_Init" LoadingPanelID="RadAjaxLoadingPanel1">
            <telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid1" PageSize="100" OnNeedDataSource="RadGrid1_NeedDataSource" runat="server">
                <PagerStyle Mode="NextPrevAndNumeric" />
                <GroupingSettings CaseSensitive="false" />
                <MasterTableView AllowCustomPaging="true" AllowPaging="true" TableLayout="Fixed">
                    <Columns>
                        <telerik:GridBoundColumn UniqueName="ScreenName" HeaderText="ScreenName" HeaderStyle-Width="250px" DataField="ScreenName"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="ProfileImage" HeaderText="Photo" HeaderStyle-Width="250px" DataField="ProfileImage"></telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings ReorderColumnsOnClient="true" AllowColumnsReorder="true" ColumnsReorderMethod="Reorder">
                    <Virtualization EnableVirtualization="true" InitiallyCachedItemsCount="100"
                        LoadingPanelID="RadAjaxLoadingPanel1" ItemsPerView="100" />
                    <Scrolling AllowScroll="true" EnableVirtualScrollPaging="true" UseStaticHeaders="true" ScrollHeight="500px" />
                    <Resizing AllowColumnResize="true" />
                </ClientSettings>
                <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
            </telerik:RadGrid>

        </telerik:RadAjaxPanel>
  2. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 31 Jan 2014 Link to this post

    Hello Dan,

    Thank you for contacting us.

    RadGrid Virtualization functionality is not implemented to works with custom paging, therefore you can not get them work fine together. However, I discussed this scenario with our developers and they said that we can improve the Virtualization in order to make it work when custom paging is enabled. We have also logged this request in our ideas and feedback portal.

    We are sorry for the inconvenience this might cause you.

    Regards,
    Pavlina
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. Chandini
    Chandini avatar
    1 posts
    Member since:
    Nov 2019

    Posted 14 Nov 2019 in reply to Pavlina Link to this post

    Hello Dan,

    I'm checking to see if the custom paging works with the virtualization now? Please update

     

    Thanks

  4. Eyup
    Admin
    Eyup avatar
    3892 posts

    Posted 19 Nov 2019 Link to this post

    Hello Chandini,

     

    There is now a solution to demonstrate how you can achieve this requirement. You can find the Knowledge Base link provided here:
    https://feedback.telerik.com/aspnet-ajax/1375407-add-radgrid-virtualization-custompaging-support

    I hope this will prove helpful.

     

    Regards,
    Eyup
    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.
Back to Top