Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
535
Suppress automatic reevaluate filters on data change
posted

Hi there,

I’m facing right now a strange behavior when I want to suppress the automatic reevaluate and filtering of my data in my xamDataGrid.

My goal is that I when I set a filter in my xamDataGrid the filtered elements remain the same, even when I change the values and even if the new value violates my filtering-rule. To achieve this I set the FieldLayoutSettings attribute ReevaluateFiltersOnDataChange and ReevaluateFiltersOnRecordsAdded to false on any relevant xamDataGrid.

Strangely in some DataGrids it works like a charm and other DataGrids totally ignore this setting. Sadly I can’t create an example, because as soon I try to make a sample project everything works just fine. But in general I have mostly the same Settings in every DataGrid (copy&paste ftw).

Another strange behavior is this that in some DataGrid this functionality was already given but not by implementing the above mentioned attributes, just by accident I had this behavior.

In general I use “complex” objects for the columns, so mostly I have some kind of wrapper object I bind to the UnboundField. But it doesn’t really matters because some other time I use just string properties.

Sometimes I use AutoGenerateFields true and sometimes not, but in both cases I can observe the problem. I often have to extend the .xaml.cs file to archive my wanted experience but I never really did anything which include the filter-behavior.

I understand that you probably can’t really help me without a reproducible sample project but at this point I only hope you have some general direction you can point me. Maybe because you know some constellation where the reevaluate can be tricked or overridden.

 

The only sample project I could create is to show the opposite effect. I activated the attributes but when I filter for a specific year in my grid and change the year after the filtering, then the row will still be displayed.

For example I filter for the year 2014 and only one row will be shown, then I change the year of that row to 2015 the row will be still be displayed but in the ToolTip of the filter It’s say ‘=2014”.

The used FieldLayoutSettings in the example is mostly my standard settings I use in every DataGrid and almost every other Grid is build this way.

 

BR

Andreas Hensel

20170825_FilterProblem.zip