New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Connecting to Web Service

Instructions to create and configure the RadClientDataSource.

Create & Bind the Controls

<telerik:RadClientDataSource ID="RadClientDataSource1" runat="server">
    <DataSource>
        <WebServiceDataSourceSettings ServiceType="OData">
            <Select Url="https://demos.telerik.com/kendo-ui/service/Northwind.svc/Products" DataType="JSONP" />
        </WebServiceDataSourceSettings>
    </DataSource>
</telerik:RadClientDataSource>
  • Configure the Model Schema and set the Fileds for the data source control
<telerik:RadClientDataSource ID="RadClientDataSource1" runat="server">
    <DataSource>
        <WebServiceDataSourceSettings ServiceType="OData">
            <Select Url="https://demos.telerik.com/kendo-ui/service/Northwind.svc/Products" DataType="JSONP" ContentType="application/json" />
        </WebServiceDataSourceSettings>
    </DataSource>
    <Schema GroupsName="ProductName">
        <Model ID="Model1">
            <telerik:ClientDataSourceModelField FieldName="ProductName" DataType="String" Editable="true" IgnoreCase="true" />
            <telerik:ClientDataSourceModelField FieldName="QuantityPerUnit" DataType="String" Nullable="false" />
            <telerik:ClientDataSourceModelField FieldName="UnitPrice" DataType="Number" />
            <telerik:ClientDataSourceModelField FieldName="UnitsInStock" DataType="Number" />
            <telerik:ClientDataSourceModelField FieldName="Discontinued" DataType="Boolean" />
        </Model>
    </Schema>
    <GroupExpressions>
        <telerik:ClientDataSourceGroupExpression FieldName="ProductName">
        </telerik:ClientDataSourceGroupExpression>
    </GroupExpressions>
</telerik:RadClientDataSource>  
  • Assign the ClientDataSource to the DataBound control (e.g. RadGrid)

Using Visual Studio Designer

client-data-source-id

Using the Source

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowFilteringByColumn="true" ClientDataSourceID="RadClientDataSource1">
    <MasterTableView AutoGenerateColumns="False">
        <Columns>
            <telerik:GridBoundColumn DataField="ProductName" UniqueName="ProductName" HeaderText="ProductName">
            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn DataField="QuantityPerUnit" UniqueName="QuantityPerUnit" HeaderText="QuantityPerUnit">
            </telerik:GridBoundColumn>

            <telerik:GridNumericColumn DataField="UnitPrice" UniqueName="UnitPrice" HeaderText="UnitPrice">
            </telerik:GridNumericColumn>

            <telerik:GridNumericColumn DataField="UnitsInStock" UniqueName="UnitsInStock" HeaderText="UnitsInStock">
            </telerik:GridNumericColumn>

            <telerik:GridBoundColumn DataField="Discontinued" UniqueName="Discontinued" HeaderText="Discontinued">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Result

client-data-source-grid

In this article
Not finding the help you need? Improve this article