Search code examples
wpfmvvmtelerikvirtualizationradgrid

Select All CheckBox in RadGridView Header Column with Filterable Columns and Row Virtualization ON


I have a RadGridView, with filterable columns. I need to add a checkbox in the column header that checks all the rows that are a result of certain filters (if used).

When the CheckBox on the Header Column is checked, I just cannot update the values in the Binded collection, since there are Filters that user may apply to certain columns.

So, I tried the following:

var rows = EntityDataGridView.ChildrenOfType<GridViewRow>();

I then loop through the rows and update its data context. This solution works fine, however it does not work well with Row Virtualization turned ON. It only updates the VIsible rows on the screen. We have to deal with large amounts of data so we cannot turn off row virtualization.

I have a solution in mind, but I am posting this to get some more ideas on how this can be solved in a quick and better way.

The solution I have it, I pass to the View Model, the filter descriptors of the RadGridView, and then manually apply filtes to the collection in the view model and then, update the checkbox state. But is there a better way to handle this?


Solution

  • LOL, the solution to this problem turned out to be quite trivial, the "Items" property on the RadGridView has the filtered items and not the items from the data source. So, I used that one instead!