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

Grid with custom datasource did not call insert/update/delete methods

7 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vladimir
Top achievements
Rank 1
Vladimir asked on 28 Nov 2013, 10:57 AM

Hi,


I have implemented universal list editor, which allow me to simple edit entities by EntityDataSource. It works ok with automatic insert/update/delete functionality.



Now I'm starting new web project based on Code First EF6. So I cannot use EntityDataSource. I downloaded DatabaseDataSource from https://dbcontextdatasource.codeplex.com/



Datasource works correctly for selecting but it does not works with automatic insert/update and delete commands.



I looked to RadGrid source code and it looks that it works only with knowing datasources from .Net framework, but not with custom datasources. The insert/update/delete commands are invoked on Grid but it is not invoked to data source.



Is there some solution how to do with custom datasource or another solution how to works with automatic CUD operations with RadGrid and Code First EF6?



Thanks

Vlad

7 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 03 Dec 2013, 11:33 AM
Hello,

Currently Microsoft still does not provide support for Entity Data Source with EF6. You could review the online resources below which elaborate on this case;
http://entityframework.codeplex.com/discussions/434936
http://stackoverflow.com/questions/19792144/entity-datasource-not-working-with-entity-framework-6-upgrade

Regards,
Maria Ilieva
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Vladimir
Top achievements
Rank 1
answered on 03 Dec 2013, 01:29 PM

Hi Maria,


thanks for reply.



I know that entitydatasource cannot be used with EF6. This is why I'm trying described DataSourceControl for EntityFramework CodeFirst.



So I'm asking about custom data source used with RadGrid. Select methods works correctly but grid does not invoke insert/update/delete methods on my custom data source view. It means that this is not supported by Telerik Grid control? I can see that radgrid has hardcoded data sources and data views in code.



Also I'm trying SelectMethod in ASP.NET 4.5 Model binding but it looks that when I have enabled filters in RadGrid it is filtered in memory.

Is it a bug? Will you support automatic grid filtering with ASP.NET 4.5 Model binding method?



Thank you

Vlad

0
Maria Ilieva
Telerik team
answered on 06 Dec 2013, 03:44 PM
Hi Vladimir,

Note that in case custom DataSource is used you should manually handle its Updating/Inserting/Deleting events to manually perform the needed operation.

As for the filtering question I'm not completely sure what the issue you are facing is. Note that Ii order to filter the data source of the data bound control and pass the filtered data to the control you could pass filter parameters to the SelectMethod. You could get these parameters from query string, cookies, form values, controls, ViewState, session and profile. For example:
public IQueryable<Product> GetProducts([Control("RadComboBoxCategories")] int? categoryID, [QueryString]string name)
{
    // Filter the data source based on categoryID and ProductName
}


Regards,
Maria Ilieva
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Vladimir
Top achievements
Rank 1
answered on 06 Dec 2013, 07:55 PM

Hi Maria,


thank you for explaining.



Regarding filtering, I though that when I have enabled automatically generated filters in RadGrid (by AllowFilteringByColumn attribute on MasterTableView described for example here http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/basic-filtering/defaultcs.aspx) It causes that grid load all data to memory and do filtering, pagging and sorting in memory.



So I have question if it will solved in some next release or we have to create own filters outside grid and manually construct filter conditions (how you described in code above).



Regards

Vlad

0
Maria Ilieva
Telerik team
answered on 11 Dec 2013, 12:17 PM
Hi Vladimir,

Due to the fact the FilterExpressions are different for the different DataSources  there is a list of DataSource Views which could be filtered by the RadGrid control. Unfortunately we could not be aware of the way all different custom DataSources implements the filtering functionality and what kind of expressions should be passed.
Currently you should create your own filters outside grid and manually construct filter conditions.

Regards,
Maria Ilieva
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
miksh
Top achievements
Rank 1
Iron
answered on 07 Mar 2014, 07:47 PM
Any changes in radGrid after MS added such support?

http://blogs.msdn.com/b/webdev/archive/2014/02/28/announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6.aspx
0
Maria Ilieva
Telerik team
answered on 12 Mar 2014, 01:12 PM
Hello Michael,

The RadGrid control is properly working with the mentioned version of the EntityDataSourceControl which is officially supported with EntityFramework 6.0.
Note that this is not the default EntityDataSourceControl but the Microsoft ASP.NET EntityDataSource control 6.0.0 which could be downloaded here:
http://www.nuget.org/packages/Microsoft.AspNet.EntityDataSource/

Regards,
Maria Ilieva
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
Grid
Asked by
Vladimir
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Vladimir
Top achievements
Rank 1
miksh
Top achievements
Rank 1
Iron
Share this question
or