RadGrid for ASP.NET AJAX

RadControls for ASP.NET AJAX

The ASP.NET 3.5 framework introduces two new ways to supply data to your ASP.NET server controls - binding to Windows Communication Foundation (WCF) Web Service and binding to ADO.NET Data Services. They allow the developer to use asynchronous calls using these types of services in order to retrieve data, return it back to the client and update the state of controls based on the result which is send back from the service. Below are a couple of tutorials which include step by step directions how to configure WCF service and ADO.NET Data Services with VS 2008:

WCF services getting started tutorial

Using Microsoft ADO.NET Data Services

RadGrid for ASP.NET AJAX exposes declarative way to binding itself to data returned from WCF web service or ADO.NET Data Service which is presented in the following online demo of the product. Additionally, both grids from the example support paging/sorting/filtering without any extra coding.

Binding RadGrid for ASP.NET AJAX to WCF Web Service

For the first RadGrid, which is bound to WCF Web Service, you need to specify an existing web service and method with following signature:

CopyASPX
<ClientSettings>
    <DataBinding SelectMethod="GetDataAndCount" Location="GridWcfService.svc"
        SortParameterType="Linq" FilterParameterType="Linq">
    </DataBinding>
</ClientSettings>

where ResultData is custom class that holds data returned from the service to client. The signature of this class and the GridWcfService.svc file (used in the demo) are shown below:

CopyGridWcfService.svc
<%@  servicehost language="C#" debug="true" service="GridWcfService" codebehind="~/App_Code/GridWcfService.cs" %>

Binding RadGrid for ASP.NET AJAX to ADO.NET Data Service

The second RadGrid from the online example referenced above is bound to ADO.NET Data Service. You need to point an existing ADO.NET data service to generate the grid content and specify the following settings:

CopyASPX
<ClientSettings>
    <DataBinding Location="GridAdoNetDataService.svc" SelectCountMethod="GetCount">
           <DataService TableName="Products" />
    </DataBinding>
</ClientSettings>

and GetCount method:

The syntax of the ADO.NET Data Service class and the GridAdoNetDataService.svc file from the sample is presented in the forthcoming section:

CopyGridAdoNetDataService.svc
<%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory" Service="GridAdoNetDataService" %>