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
Hello Andres,
Thank you for your feedback.
You can try the PreLoadRecords mode of XamDataGrid, just in case if the issue is related with lazily evaluated filters. In order to set this mode you can use RecordLoadMode property.
Let me know if you have any questions.
Sincerely,ZhivkoAssociate Software Developer
Hello Zhivko,
Thank you for your response, I know it would be hard to find the solution for my problem without any sample with my mentioned behavior. So from my side my problem isn’t really fixed but my answer is.
When I can find a solution or a way to create a reproducible project I will reopen this thread again.
Andreas
Thank you for the details you have provided.
In the attached project the ReevaluateFiltersOnDataChange is set to true, so it is expected the record filters to be re-evaluated, whenever cell data changes. If I set it to false, then re-evaluation works as expected. By default the XamDataGrid will re-evaluate filters on a record if that record's data changes. If you set the ReevaluateFiltersOnDataChange to false, then this should be prevented. Unfortunatelly, I am unable to conclude what can cause such issue without а sample application, where the issue you are having with the re-evaluation of Filtering is reproducible.
Please let me know if I can provide any further assistance.