Hello Telerik,
is the a way to use a QueryableEntityCollectionView object (bounded to a RadGridView) with EF6 which has a DBContext instate of ObjectContext?
I'm chaining my Telerik application form EF 4 to EF 6.
Or can you give me a link to a simple GridView example using Entity Framework 6?
Regards Uwe
is the a way to use a QueryableEntityCollectionView object (bounded to a RadGridView) with EF6 which has a DBContext instate of ObjectContext?
I'm chaining my Telerik application form EF 4 to EF 6.
Or can you give me a link to a simple GridView example using Entity Framework 6?
Regards Uwe
7 Answers, 1 is accepted
0
Accepted
Hi Uwe,
You should not have problems populating RadGridView with data using EF6. You can check the RadEntityFrameworkDataSource examples in our WPF Demos for a reference.
Please note that in case you get RadEntityFrameworkDataSource to work with EF6, you should reference the Telerik.Windows.Controls.EntityFramework60 assembly.
Regards,
Dimitrina
Telerik
You should not have problems populating RadGridView with data using EF6. You can check the RadEntityFrameworkDataSource examples in our WPF Demos for a reference.
Please note that in case you get RadEntityFrameworkDataSource to work with EF6, you should reference the Telerik.Windows.Controls.EntityFramework60 assembly.
Regards,
Dimitrina
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Uwe
Top achievements
Rank 1
answered on 28 Oct 2014, 07:03 PM
Hello Dimitrina thank you for answering.
I tried the EntityFrameworkDataSourceExample in the new demos for 2014 Q3, I ported it to a small own WPF app and it works fine. But I have still this problem. Which crash my application (or any other exception from the sql server). Except I catch the exception in OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) in App.xaml.cs. What is also not a good solution.
So is their any possibility to catch the sql exception on a better place, or is it, in this case, necessary to build a n-tier architecture or something like that?
Thank you for your effort
I tried the EntityFrameworkDataSourceExample in the new demos for 2014 Q3, I ported it to a small own WPF app and it works fine. But I have still this problem. Which crash my application (or any other exception from the sql server). Except I catch the exception in OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) in App.xaml.cs. What is also not a good solution.
So is their any possibility to catch the sql exception on a better place, or is it, in this case, necessary to build a n-tier architecture or something like that?
Thank you for your effort
0
Uwe
Top achievements
Rank 1
answered on 30 Oct 2014, 11:44 AM
OK, after clearing the solution and making a new build, all demos works correct!
0
Uwe
Top achievements
Rank 1
answered on 23 Jan 2015, 08:19 AM
Hello Dimitrina,
RadEntityFrameworkDataSource is an UI-Element and Works fine in a non MVVM environment. Referring to my first post I'm using QueryableEntityCollectionView in my projects and link it withe the ObjectContext of my Entities. Microsoft removed the ObjectContext in EF 6. In the regular Telerik Demo I can not find an example for the RadGridView using EF 6 in MVVM.
So maybe is there a is there another example?
Regards Uwe
RadEntityFrameworkDataSource is an UI-Element and Works fine in a non MVVM environment. Referring to my first post I'm using QueryableEntityCollectionView in my projects and link it withe the ObjectContext of my Entities. Microsoft removed the ObjectContext in EF 6. In the regular Telerik Demo I can not find an example for the RadGridView using EF 6 in MVVM.
So maybe is there a is there another example?
Regards Uwe
0
Hi Uwe,
Following the demo for MVVM support of RadEntityFrameworkDataSource, there should be no difference when using EF4 or EF6. If you need to get the context, you should use DbContext instead.
What are the difficulties that you encountered when using this approach with EF6 ?
Regards,
Maya
Telerik
Following the demo for MVVM support of RadEntityFrameworkDataSource, there should be no difference when using EF4 or EF6. If you need to get the context, you should use DbContext instead.
What are the difficulties that you encountered when using this approach with EF6 ?
Regards,
Maya
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Uwe
Top achievements
Rank 1
answered on 20 Feb 2015, 06:52 AM
Hello Maya,
thank you for helping, my be the misunderstanding is that my data source is in the ViewModel! But I think I solved the problem well, doing this:
were BAEntities is driven from DbContext
But for this it is necessary to use .Net 4.5
Regards Uwe
thank you for helping, my be the misunderstanding is that my data source is in the ViewModel! But I think I solved the problem well, doing this:
private ObjectContext oC;
...
private QueryableEntityCollectionView<
BAMeasurement
> bAMeasurements;
...
BAEntities BAEntitiesObj = new BAEntities(_msdb.GetSQLConnectionStringFromProperties());
oC = ((IObjectContextAdapter)BAEntitiesObj).ObjectContext;
bAMeasurements = new QueryableEntityCollectionView<
BAMeasurement
>(oC, "BAMeasurements");
were BAEntities is driven from DbContext
But for this it is necessary to use .Net 4.5
Regards Uwe
0
Accepted
Hi Uwe,
Glad to see you resolved the issue. Let me know if you need further assistance.
Regards,
Maya
Telerik
Glad to see you resolved the issue. Let me know if you need further assistance.
Regards,
Maya
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.