Getting Started with WPF DataServiceDataSource
This tutorial will walk you through the creation of a sample application that contains RadDataServiceDataSource control.
Assembly References
To use the RadDataServiceDataSource in your projects you have to add references to the following assemblies:
- Telerik.Windows.Controls
- Telerik.Windows.Controls.DataServices
If you are using OData version 3 you need to add reference to Telerik.Windows.Controls.DataServices50 which is built against Microsoft.Data.Services.Client with version 5.6.4.
For OData version 4 support, you need to add reference to Telerik.Windows.Controls.DataServices60 which is built against Microsoft.OData.Client with version 6.15.0.
Since the R2 2021 release, you can find a Telerik.Windows.Controls.DataServices dll in the WPF60 and WPF70 folders built against Microsoft.OData.Client with version 7.8.3.
You can find the required assemblies for each control from the suite in the Controls Dependencies help article.
Adding Telerik Assemblies Using NuGet
To use RadDataServiceDataSource when working with NuGet packages, install the Telerik.Windows.Controls.DataServices.for.Wpf.Xaml
package. The package name may vary slightly based on the Telerik dlls set - Xaml or NoXaml
Read more about NuGet installation in the Installing UI for WPF from NuGet Package article.
Adding RadDataServiceDataSource
We will use RadGridView control in order to visualize the data.
Example 1: Using RadDataServiceDataSource with RadGridView
<telerik:RadDataServiceDataSource Name="customersDataSource" QueryName="Products" AutoLoad="True">
<telerik:RadDataServiceDataSource.DataServiceContext>
<local:ProductsContext/>
</telerik:RadDataServiceDataSource.DataServiceContext>
</telerik:RadDataServiceDataSource>
<telerik:RadGridView Grid.Row="0" ItemsSource="{Binding DataView, ElementName=customersDataSource}"
IsBusy="{Binding IsBusy, ElementName=customersDataSource}"
ShowGroupPanel="False"/>
See also
Telerik UI for WPF Learning Resources
- Telerik UI for WPF DataServiceDataSource Component
- Getting Started with Telerik UI for WPF Components
- Telerik UI for WPF Installation
- Telerik UI for WPF and WinForms Integration
- Telerik UI for WPF Visual Studio Templates
- Setting a Theme with Telerik UI for WPF
- Telerik UI for WPF Virtual Classroom (Training Courses for Registered Users)
- Telerik UI for WPF License Agreement