Force filtering to refresh when values in existing rows are updated

9 posts, 1 answers
  1. Marcus
    Marcus avatar
    14 posts
    Member since:
    Sep 2010

    Posted 06 Jun 2013 Link to this post

    I have filtering enabled in my RadGridView column.  When an existing row has it's cell value updated for the filtered column, the row should be excluded if it's outside of the filter parameters - however, this is not the case.  I have to manually go back and adjust the filter for the row to be excluded.

    How can I ensure that all current data in the grid is correctly filtered, even when cells are updated after the row is added?
  2. Marcus
    Marcus avatar
    14 posts
    Member since:
    Sep 2010

    Posted 07 Jun 2013 Link to this post

    Hi,  any ideas on this?

    thanks.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Nick
    Admin
    Nick avatar
    593 posts

    Posted 07 Jun 2013 Link to this post

    Hi Marcus,

    This seems a bit strange, the Grid should handle the change and exclude the item. May I ask to provide a bit more information on your project? Are there any customizations that could interfere with the default behavior? A sample project would be very nice! 
    As a side note, you can try raising a CollectionChanged event for your ItemsSource after the edit with a status Reset, which will take care of the issue. 

    Hope this helps! 

    Regards,
    Nik
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Nick
    Admin
    Nick avatar
    593 posts

    Posted 07 Jun 2013 Link to this post

    Hello Marcus,

    Just a quick follow-up. The grid view handles the change only on BeginEdit + EndEdit methods calls combination. 
    You need to raise a collection change of any kind to enable the behavior otherwise. The easiest way is to add and remove a dummy object in your collection.

    Hope this helps! 

    Regards,
    Nik
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Marcus
    Marcus avatar
    14 posts
    Member since:
    Sep 2010

    Posted 07 Jun 2013 Link to this post

    I think I need to clarify - the cell values are updated asynchronously on the row model objects, and I raise a NotifyPropertyChanged event on the row for the relevant property. I'm not editing the grid itself. I would expect that when a row fires a NPC event for a filtered property, the filter should detect this and update?
  7. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 07 Jun 2013 Link to this post

    Hello,

    Can we please keep all related forum posts in one thread, since as it appears that they discuss the same thing. Please, see my answer to your other forum post which asks the same. Thank you.

    "I'm not editing the grid itself. I would expect that when a row fires a NPC event for a filtered property, the filter should detect this and update?"

    It will not update for performance reasons and that is by design. We don't recreate a view which can contain millions of records simply because one of the properties of one of them has changed.

    You have three options in order of preference:

    1. BeginEdit -> EndEdit. Read my other post.
    2. Remove your item from the collection, edit it, and then add it back again. We will determine whether it passes the filter and so on.
    3. Call RadGridView.Rebind if you want to re-create the entire view and don't care about performance.

    Now, I would like to ask you to keep our conversations in as little number of different threads as possible, since at the moment there are like 5 threads for one and the same subject and you are speaking with different support officers simultaneously and there is quite a lot of miscommunication, i.e. we are explaining the same thing in 3 different threads.

    Thank you.

    Regards,
    Rossen Hristov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Marcus
    Marcus avatar
    14 posts
    Member since:
    Sep 2010

    Posted 07 Jun 2013 Link to this post

    Thanks, I've gone with option 2.  All makes sense.

    I would consider all my questions to actually be separate issues, hence the different threads.  This and the nested bindings questions perhaps overlap, but I considered this a filtering issue.  It just turns out they may be both fixed by the same underlying changes.
  9. Doug
    Doug avatar
    7 posts
    Member since:
    May 2013

    Posted 08 Jul Link to this post

    This issue is very annoying.  We too use MVVM with a notify change event that updates the collection the gridview uses.  That updates the data just fine, but leaves the filters almost useless for real time data.  Please fix this.
  10. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 13 Jul Link to this post

    Hi Doug,

    I am sorry to hear that the way the filtering mechanism is designed does not fulfill your project needs. Unfortunately, as my colleague has stated in the thread, we have decided to give priority to the performance of the filtering and updating the filters on PropertyChanged will be a costly operation in such perspective. With this in mind, I suggest you consider the options for bypassing the default behavior that were discussed in the thread. 

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready