Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
title: Getting Started
page_title: Getting Started
description: Check our "Getting Started" documentation article for the RadDataServiceDataSource {{ site.framework_name }} control.
description: Check our "Getting Started" documentation article for the RadDataServiceDataSource WPF control.
slug: raddataservicedatasource-getting-started
tags: getting,started
published: True
position: 0
---

# Getting Started with {{ site.framework_name }} DataServiceDataSource
# Getting Started with WPF DataServiceDataSource

This tutorial will walk you through the creation of a sample application that contains __RadDataServiceDataSource__ control.
This tutorial will walk you through the creation of a sample application that contains `RadDataServiceDataSource` control.

## 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]({%slug nuget-available-packages%}) slightly based on the Telerik dlls set - [Xaml or NoXaml]({%slug xaml-vs-noxaml%})
To use RadDataServiceDataSource when working with NuGet packages, install the `Telerik.Windows.Controls.DataServices.for.Wpf.Xaml` package. The [package name may vary]({%slug nuget-available-packages%}) slightly based on the Telerik dlls set - [Xaml or NoXaml]({%slug xaml-vs-noxaml%})

Read more about NuGet installation in the [Installing UI for WPF from NuGet Package]({%slug nuget-installation%}) article.

Expand All @@ -28,19 +28,15 @@ If you are not using NuGet packages, you can add a reference to the following as
* __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__.
>With the release of the 2025 Q4, the __Telerik.Windows.Controls.DataServices50__ and __Telerik.Windows.Controls.DataServices60__ assemblies have been removed. Instead, use the __Telerik.Windows.Controls.DataServices__ assembly, which is built against the __Microsoft.OData.Client__ NuGet package with version __7.8.3__.

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 {% if site.site_name == 'Silverlight' %}[Controls Dependencies]({%slug installation-installing-controls-dependencies%}){% else %}[Controls Dependencies]({%slug installation-installing-controls-dependencies-wpf%}){% endif %} help article.
You can find the required assemblies for each control from the suite in the[Controls Dependencies]({%slug installation-installing-controls-dependencies-wpf%}) help article.

## Adding RadDataServiceDataSource

We will use __RadGridView__ control in order to visualize the data.
We will use `RadGridView` control in order to visualize the data.

__Example 1: Using RadDataServiceDataSource with RadGridView__
__Using RadDataServiceDataSource with RadGridView__
```XAML
<telerik:RadDataServiceDataSource Name="customersDataSource" QueryName="Products" AutoLoad="True">
<telerik:RadDataServiceDataSource.DataServiceContext>
Expand All @@ -57,7 +53,6 @@ __Example 1: Using RadDataServiceDataSource with RadGridView__
- [Overview]({%slug raddataservicedatasource-overview%})
- [CRUD]({%slug raddataservicedatasource-crud%})

{% if site.site_name == 'WPF' %}
## Telerik UI for WPF Learning Resources

* [Telerik UI for WPF DataServiceDataSource Component](https://www.telerik.com/products/wpf/dataservicedatasource.aspx)
Expand All @@ -67,6 +62,4 @@ __Example 1: Using RadDataServiceDataSource with RadGridView__
* [Telerik UI for WPF Visual Studio Templates]({%slug visual-studio-templates%})
* [Setting a Theme with Telerik UI for WPF]({%slug styling-apperance-implicit-styles-overview%})
* [Telerik UI for WPF Virtual Classroom (Training Courses for Registered Users)](https://learn.telerik.com/learn/course/external/view/elearning/16/telerik-ui-for-wpf)
* [Telerik UI for WPF License Agreement](https://www.telerik.com/purchase/license-agreement/wpf-dlw-s)
{% endif %}

* [Telerik UI for WPF License Agreement](https://www.telerik.com/purchase/license-agreement/wpf-dlw-s)
Original file line number Diff line number Diff line change
@@ -1,77 +1,69 @@
---
title: Getting Started
page_title: Getting Started
description: Check our &quot;Getting Started&quot; documentation article for the RadEntityFrameworkDataSource {{ site.framework_name }} control.
description: Check our &quot;Getting Started&quot; documentation article for the RadEntityFrameworkDataSource WPF control.
slug: entityframework-getting-started
tags: getting,started
published: True
position: 3
---

# Getting Started with {{ site.framework_name }} EntityFrameworkDataSource
# Getting Started with WPF EntityFrameworkDataSource

This tutorial will walk you through the creation of a sample application that contains __RadGridView__ bound to __RadEntityFrameworkDataSource__.
This tutorial will walk you through the creation of a sample application that contains `RadGridView` bound to `RadEntityFrameworkDataSource`.

* [Creating the WPF Application](#creating-the-wpf-application)
* [Creating the Model](#creating-the-model)
* [Adding RadGridView and RadEntityFrameworkDataSource](#adding-radgridview-and-radentityframeworkdatasource)

As of version __2013 Q3 SP1__ we have added support for __EntityFramework 6.0__. You will need to reference the __Telerik.Windows.Controls.EntityFramework60__ assembly, rather than the __Telerik.Windows.Controls.EntityFramework__ one in order for this to work.
>With the release of the __2025 Q4__, the __Telerik.Windows.Controls.EntityFramework__ assembly has been removed. Instead, you will need to reference the __Telerik.Windows.Controls.EntityFramework60__ assembly, which is built against the __EntityFramework__ NuGet package with version __6.5.1__.

## Adding Telerik Assemblies Using NuGet

To use __RadEntityFrameworkDataSource__ when working with NuGet packages, install the `Telerik.Windows.Controls.EntityFramework.for.Wpf.Xaml` package. The [package name may vary]({%slug nuget-available-packages%}) slightly based on the Telerik dlls set - [Xaml or NoXaml]({%slug xaml-vs-noxaml%})
To use RadEntityFrameworkDataSource when working with NuGet packages, install the `Telerik.Windows.Controls.EntityFramework.for.Wpf.Xaml` package. The [package name may vary]({%slug nuget-available-packages%}) slightly based on the Telerik dlls set - [Xaml or NoXaml]({%slug xaml-vs-noxaml%})

Read more about NuGet installation in the [Installing UI for WPF from NuGet Package]({%slug nuget-installation%}) article.

>tip With the 2025 Q1 release, the Telerik UI for WPF has a new licensing mechanism. You can learn more about it [here]({%slug installing-license-key%}).

## Creating the WPF Application

1. Note that __RadEntityFrameworkDataSource__ is built on top of the [ADO.NET Entity Framework](https://docs.microsoft.com/en-us/ef/ef6/). Basic Entity Framework experience is required for working with __RadEntityFrameworkDataSource__.
1. Note that RadEntityFrameworkDataSource is built on top of the [ADO.NET Entity Framework](https://docs.microsoft.com/en-us/ef/ef6/). Basic Entity Framework experience is required for working with RadEntityFrameworkDataSource.

2. Start Visual Studio and create a new WPF Application.

## Creating the Model

Now that we have the application, we will add our entity model using the AdventureWorks database.

1. In the project add a new __ADO.NET Entity Data Model__. You need to make sure that **Data** is selected from the left menu.
1. In the project add a new __ADO.NET Entity Data Model__. You need to make sure that __Data__ is selected from the left menu.
![Rad Entity Framework Getting Started 1](images/RadEntityFramework_Getting_Started1.png)

2. Choose to create a model using the code first approach from an existing database.
![Rad Entity Framework Getting Started 2](images/RadEntityFramework_Getting_Started2.png)

3. Choose the data connection (for example the __AdventureWorks__ database). In order to learn how to add the AdventureWorks database, check out the [AdventureWorks Readme](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works) article.

4. Generate the entities from all of the tables in the __AdventureWorks__ database.
4. Generate the entities from all of the tables in the AdventureWorks database.

5. Click __Finish__ and __rebuild the solution__.

## Adding RadGridView and RadEntityFrameworkDataSource

Now let's go to the client side.

**1.** Add References to the following __Telerik__ assemblies:
**1.** Add References to the following Telerik assemblies:

* __Telerik.Licensing.Runtime__
* __Telerik.Windows.Controls__ (mandatory for both __RadGridView__ and __RadEntityFrameworkDataSource__)
* __Telerik.Windows.Controls__ (mandatory for both RadGridView and RadEntityFrameworkDataSource)
* __Telerik.Windows.Controls.EntityFramework60__ (mandatory for RadEntityFrameworkDataSource with EF __6.0__ or later)
* __Telerik.Windows.Controls.GridView__ (mandatory for RadGridView)
* __Telerik.Windows.Controls.Input__ (mandatory for RadGridView)
* __Telerik.Windows.Data__ (mandatory for both RadGridView and RadEntityFrameworkDataSource)

* __Telerik.Windows.Controls.EntityFramework__ (mandatory for __RadEntityFrameworkDataSource__ with EF **5.0** or previous)
**2.** Now add the RadGridView and RadEntityFrameworkDataSource controls to the main window. The following example demonstrates how you can do that.

or

* __Telerik.Windows.Controls.EntityFramework60__ (mandatory for __RadEntityFrameworkDataSource__ with EF **6.0** or later)

* __Telerik.Windows.Controls.GridView__ (mandatory for __RadGridView__)

* __Telerik.Windows.Controls.Input__ (mandatory for __RadGridView__)

* __Telerik.Windows.Data__ (mandatory for both __RadGridView__ and __RadEntityFrameworkDataSource__)

**2.** Now add the __RadGridView__ and __RadEntityFrameworkDataSource__ controls to the main window. **Example 1** demonstrates how you can do that.

__Example 1: Adding RadGridView and RadEntityFrameworkDataSource__
__Adding RadGridView and RadEntityFrameworkDataSource__

```XAML
<Window x:Class="EntityFrameworkGettingStarted.MainWindow"
Expand All @@ -94,8 +86,6 @@ __Example 1: Adding RadGridView and RadEntityFrameworkDataSource__
</Window>
```

>importantSince __Q3 SP1 2012__ we have added the __RadEntityFrameworkDataSource.DbContext__ property which should be set instead of the **ObjectContext** property for versions of Entity Framework newer than version **5.0**. If you are using an older version of Entity Framework, you can set the **RadEntityFrameworkDataSource.ObjectContext** property.

Several important things to notice:

* The import of the telerik schema: __xmlns:telerik="[http://schemas.telerik.com/2008/xaml/presentation](http://schemas.telerik.com/2008/xaml/presentation)__
Expand All @@ -108,9 +98,9 @@ Several important things to notice:

## RelatedObjects

The __RelatedObjects__ property of the RadEntityFrameworkDataSource allows you to specify the names of the related entities that need to be retrieved. For example, if your main entity set is called "Customers", you might want to retrieve the "Orders" collection in case you want to get the related Orders for each Customer from the database.
The `RelatedObjects` property of the RadEntityFrameworkDataSource allows you to specify the names of the related entities that need to be retrieved. For example, if your main entity set is called "Customers", you might want to retrieve the "Orders" collection in case you want to get the related Orders for each Customer from the database.

__Example 2: Using the RelatedObjects__
__Using the RelatedObjects__
```XAML
<telerik:RadEntityFrameworkDataSource Name="EntityFrameworkDataSource" QueryName="Customers">
<telerik:RadEntityFrameworkDataSource.RelatedObjects>
Expand All @@ -122,7 +112,6 @@ __Example 2: Using the RelatedObjects__
</telerik:RadEntityFrameworkDataSource>
```

{% if site.site_name == 'WPF' %}
## Telerik UI for WPF Learning Resources

* [Telerik UI for WPF EntityFrameworkDataSource Component](https://www.telerik.com/products/wpf/entity-framework-data-source.aspx)
Expand All @@ -133,7 +122,6 @@ __Example 2: Using the RelatedObjects__
* [Setting a Theme with Telerik UI for WPF]({%slug styling-apperance-implicit-styles-overview%})
* [Telerik UI for WPF Virtual Classroom (Training Courses for Registered Users)](https://learn.telerik.com/learn/course/external/view/elearning/16/telerik-ui-for-wpf)
* [Telerik UI for WPF License Agreement](https://www.telerik.com/purchase/license-agreement/wpf-dlw-s)
{% endif %}

## See also

Expand Down
Loading