Defer Filtering on RadGridView

2 posts, 0 answers
  1. Charlie
    Charlie avatar
    2 posts
    Member since:
    Mar 2015

    Posted 23 Aug Link to this post


    I have a WPF MVVM application with several screens with grids. I currently use FilteringMode="FilterRow" on these grids. The problem I'm having is that after each filter is changed and loses focus, a database trip is made. This is very expensive and slow (going through OData and EF). I would like to defer all filtering until the user clicks a button. I can do this now by not binding a command to the Filtered event, but a change in filter still filters the grid page that currently has focus.

    I have done some searching around and I do see that it's not possible to defer filtering when using FilterRow but I would like to explore what options I do have. Popup mode is not an option here as there's too much code to switch out. I saw Custom Filtering as an option but keep in mind that I have lots of grids each with lots of columns (my grid I'm testing with has 56 columns) and I have to be able to apply this across the board.

    What I'm ultimately looking for is a way for a user to type their filters into whatever fields they choose and then click 1 button to apply all of them at once. The grid should not update at all when each field loses focus.

    Any suggestions?

  2. Dilyan Traykov
    Dilyan Traykov avatar
    342 posts

    Posted 26 Aug Link to this post

    Hello Charlie,

    I'm afraid that the desired behavior cannot be achieved with the current implementation of the control when using the FilterRow FilteringMode.

    You could, however, achieve the desired behavior by creating your custom filtering controls and using the Popup FilteringMode and setting the FilteringControl property of each column in RadGridView's Loaded event.

    I'm attaching a sample project demonstrating the approach I have in mind. Please have a look at it and let me know whether such an approach would be suitable for you.

    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft banner
Back to Top