Grid

Controls

All Controls

Grid

Rate this demo

Thank you for your post!

Grid - Client-Side Binding and Caching

IDNameUnit priceDateDiscontinued
Data pager
 Page 1 of 2, items 1 to 10 of 11.
    
    
    
    
    
    
    
    
    
    
With client-side caching enabled RadGrid will store the start row index, maximum rows, sorting and filtering expressions and will retrieve them from the cache automatically on subsequent client-side refreshes. Hence this data will not be transferred between the client and the server which will save bandwidth and loading time when the grid is rebound on the client.
This example demonstrates how to enable/disable the grid client-side caching.

RadGrid can cache data on the client based on the current grid state. To enable/disable this feature you can use the ClientSettings.DataBinding.EnableCaching property (its default value is false):
    ...
    <ClientSettings>
        <DataBinding Location="~/Grid/Examples/Client/DeclarativeDataBinding/WebService.asmx"
            SelectMethod="GetDataAndCount" EnableCaching="true" />
    </ClientSettings>
    ...
    
C# VB
Show code in new window Demo isolation steps
<%@ Page Language="c#"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
    <title>Client-Side Binding for ASP.NET AJAX Grid | RadGrid Demo</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadGrid ID="RadGrid1" AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="true"
        AutoGenerateColumns="false" runat="server">
        <MasterTableView>
            <Columns>
                <telerik:GridBoundColumn DataField="ID" HeaderText="ID" DataType="System.Int32">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Name" HeaderText="Name">
                </telerik:GridBoundColumn>
                <telerik:GridNumericColumn DataField="UnitPrice" HeaderText="Unit price" DataType="System.Decimal">
                </telerik:GridNumericColumn>
                <telerik:GridBoundColumn DataField="Date" DataFormatString="{0:d}" HeaderText="Date"
                    DataType="System.DateTime">
                </telerik:GridBoundColumn>
                <telerik:GridCheckBoxColumn DataField="Discontinued" HeaderText="Discontinued" DataType="System.Boolean">
                </telerik:GridCheckBoxColumn>
            </Columns>
        </MasterTableView>
        <PagerStyle Mode="NumericPages"></PagerStyle>
        <ClientSettings>
            <DataBinding Location="../DeclarativeDataBinding/WebService.asmx" SelectMethod="GetDataAndCount"
                EnableCaching="true">
            </DataBinding>
        </ClientSettings>
    </telerik:RadGrid>
    </form>
</body>
</html>