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

Issue with virtual scrolling for large number of records

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
M. R.
Top achievements
Rank 1
M. R. asked on 18 Jul 2012, 04:56 PM
Hello,

I have a large SQL Server table with over 600,000 records. I am testing based on your "Grid / Virtual Scrolling and Paging" example found at: http://demos.telerik.com/aspnet-ajax/grid/examples/client/virtualscrollpaging/defaultvb.aspx

I set VirtualItemCount to the total number of records in the table, i.e. VirtualItemCount="622840". See all code below.
Once I did this change, the scrolling behavior was completely messed-up. Please see attached screen shots, showing step by step what is happening.

Using Rad Controls for ASP.Net Ajax, version 2011.3.1305 for .Net framework 4.0 and Visual Studio 2010.
<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
  CodeBehind="Default.aspx.vb" Inherits="DB2_Data._Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
  <h2>
 
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
 
  </h2>
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

   <telerik:RadGrid ID="RadGrid1" Width="97%" AllowPaging="True" PageSize="14" AllowSorting="True"
      runat="server" AllowCustomPaging="true" VirtualItemCount="622840">
      <PagerStyle Mode="NumericPages" />
      <MasterTableView TableLayout="Fixed" />
      <ClientSettings>
          <Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="True"
              SaveScrollPosition="True"></Scrolling>
      </ClientSettings>
    </telerik:RadGrid>
 
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ASWConnectionString %>"
        SelectCommand="SELECT * FROM [DB2_Customers]" ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
 
</asp:Content>

Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections.Generic
Imports Telerik.Web.UI
 
Public Class _Default
  Inherits System.Web.UI.Page
  Private Function GetDataTable(ByVal queryString As String) As DataTable
    Dim ConnString As String = ConfigurationManager.ConnectionStrings("ASWConnectionString").ConnectionString
    Dim MySqlConnection As New SqlConnection(ConnString)
    Dim MySqlDataAdapter As New SqlDataAdapter
    MySqlDataAdapter.SelectCommand = New SqlCommand(queryString, MySqlConnection)
 
    Dim myDataTable As New DataTable
    MySqlConnection.Open()
    Try
      MySqlDataAdapter.Fill(myDataTable)
    Finally
      MySqlConnection.Close()
    End Try
 
    Return myDataTable
  End Function
 
  Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
    RadGrid1.DataSource = GetDataTable("SELECT * FROM db2_customers WHERE ID BETWEEN " & ((RadGrid1.CurrentPageIndex * RadGrid1.PageSize) + 1) & " AND " & ((RadGrid1.CurrentPageIndex + 1) * RadGrid1.PageSize))
  End Sub
End Class

Regards,
M.R.

1 Answer, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 23 Jul 2012, 12:24 PM
Hello,

We are aware of this issue and our developers will have the care to it. However, this fix requires a detailed investigation and for now we cannot specify an exact date when it will be available.

All the best,
Milena
the Telerik team
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
M. R.
Top achievements
Rank 1
Answers by
Milena
Telerik team
Share this question
or