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

GridView EF6 AsNoTracking

1 Answer 20 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Artem
Top achievements
Rank 1
Artem asked on 07 Jul 2016, 11:22 AM

Hello. We have got a weird issue. We have a data provider which returns IQueryable like

Source = new QueryableCollectionView(_dbContext.Orders.AsNoTracking());

Then it's bound to the rad grid view.

 

The problem appears when edit mode is activated, after lost focus new row to the gridview is added. If I don't use AsNoTracking it works fine.

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 11 Jul 2016, 12:20 PM
Hello Artem,

As advised in the ticket you have raised, using the AsNoTracking method is generally used in a query which you intend to use for read-only data. However, applying the ToList() method to a query similar to the one provided in the 
ticket has resolved the issue with the new item added. Please test this at your end and update me with the results. Providing more information on why you need to use this method in your query in a scenario where updates are required would be appreciated.

Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Artem
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or