ComponentOne GridView for ASP.NET WebForms
Working with GridView for ASP.NET Web Forms / Virtual Scrolling
In This Topic
    Virtual Scrolling
    In This Topic

    Virtual scrolling can be used to speed up the rendering of a grid when a massive amount of data is displayed. It allows the grid to retrieve data through callbacks to the server, making the data load faster while keeping the scrolling smooth.

    The following example shows how to implement virtual scrolling for rows and columns by setting the ScrollingSettingsVirtualizationSettings and CallbackSettings properties. This markup can be added to the *.aspx page's body content.

    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">   
    
            <asp:ScriptManager ID="ScriptManager1" runat="server">
    
    </asp:ScriptManager>
    
    
    <%--Bind the grid to a datasource--%>
    
      <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\C1NWind.mdb;Persist Security Info=True"
    
            ProviderName="System.Data.OleDb" SelectCommand="SELECT * FROM ORDERS">
    
        </asp:SqlDataSource>
    

     <%--Set C1GridView's ScrollingSettings.VirtualizationSettings.Mode and CallbackSettings.Action--%>
        
    
      
    <cc1:C1GridView ID="C1GridView1" runat="server" DataSourceID="SqlDataSource1" Height="400px">
            <CallbackSettings Action="Scrolling" />
                    <ScrollingSettings Mode="Both">
                            <VirtualizationSettings Mode="Both" /> 
                    </ScrollingSettings>
    </cc1:C1GridView>
            
    


    To implement virtual scrolling for rows and columns in GridView, follow these steps:
    1. Bind the grid to a data source.
    2. Set the ScrollingSettings Mode to Both to enable the virtual scrolling feature.
    3. Set the VirtualizationSettings Mode value to Rows, Columns, or Both to allow scrolling for rows and columns accordingly.
    4. Set the Action property to Scrolling. This tells the grid to use callbacks to the server during scrolling. There are two modes of virtual scrolling determined by the CallbackSettings property. The first one is static, where all data is available to the client, but the rows are rendered when scrolled. The second mode is dynamic and set by the Scrolling value. New portions of data are requested from the server when they need to be rendered.
    See Also