Entities is not a valid ObjectContext

3 posts, 1 answers
  1. Andrew
    Andrew avatar
    4 posts
    Member since:
    Sep 2010

    Posted 11 Mar 2013 Link to this post

    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. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 11 Mar 2013 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Andrew
    Andrew avatar
    4 posts
    Member since:
    Sep 2010

    Posted 12 Mar 2013 Link to this post

    Sorry, didn't see that option!
Back to Top