This is a migrated thread and some comments may be shown as answers.

Entities is not a valid ObjectContext

2 Answers 113 Views
EntityFrameworkDataSource
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 11 Mar 2013, 12:44 PM
Hi,

I have setup Entity Framework in my WPF application and have used the example, but it keeps telling me that the object Context I am using is not allowed even though I am using the DBContext that the Entity Framework wizard created for me.

Below is my xaml:

<UserControl
...
<xmlns:data="clr-namespace:Stats.Data"
...
<Grid>
<telerik:RadEntityFrameworkDataSource Name="statsDS" QueryName="Client">
<telerik:RadEntityFrameworkDataSource.ObjectContext>
<data:StatsEntities/>
</telerik:RadEntityFrameworkDataSource.ObjectContext>
<telerik:RadEntityFrameworkDataSource>
<telerik:RadGridView itemsSource="{Binding DataView, Elementname=statsDS}"/>
</Grid>
</UserControl>

StatsEntities is the DBContext within my Entity Framework model.

2 Answers, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 11 Mar 2013, 01:08 PM
Hi,

Can you try setting the RadEntityFrameworkDataSource.DbContext property. It is for .NET 4.5 only.

Regards,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Andrew
Top achievements
Rank 1
answered on 12 Mar 2013, 05:04 AM
Sorry, didn't see that option!
Tags
EntityFrameworkDataSource
Asked by
Andrew
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or