GridView EF6 AsNoTracking

2 posts, 0 answers
  1. Artem
    Artem avatar
    3 posts
    Member since:
    Jul 2016

    Posted 07 Jul 2016 Link to this post

    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.

  2. Stefan Nenchev
    Stefan Nenchev avatar
    538 posts

    Posted 11 Jul 2016 Link to this post

    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.

    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.
Back to Top