DomainDataSource Support

The purpose of this tutorial is to show you how to populate RadGridView with data using DomainDataSource.

This tutorial will use the Northwind database, which can be downloaded from here.

  • Add a new RadGridView declaration in your XAML:

<telerik:RadGridView x:Name="radGridView" Margin="8"/> 
The gridview will be bound to a DomainDataSource. When the control is loaded all customers from the Customers table in the Northwind database are loaded asynchronously.
  • Declare a new DomainDataSource object in the resources of your application. Set its DomainContext property to an existing RIA Service.

  <telerik:DomainDataSource x:Key="DomainDataSource" AutoLoad="True" QueryName="GetCustomers"> 
    <telerik:DomainDataSource.DomainContext> 
      <local:SampleRiaContext/> 
    </telerik:DomainDataSource.DomainContext> 
  </telerik:DomainDataSource> 
  • Update your RadGridView declaration - set the ItemsSource property.

<telerik:RadGridView Margin="8" 
sSource="{Binding Source={StaticResource DomainDataSource}, Path=Data}"/> 
Run your demo, the result can be seen on the next picture:

Telerik Silverlight DataGrid PopulatingWithDataLoadFromDomainDataSource 010

If you need to define the columns manually read the topic Defining Columns.

See Also

In this article