Maurizio Maiorino
2023-10-05T09:18:33Z
Hi,
I am using the new AutoFilterManager functionality provided with iGrid.NET 11.
I would like to intercept the moment before the filter is applied, to make validations/changes, or even to prevent it from being applied.
Could this be a future improvement?
Igor/10Tec
2023-10-06T07:41:17Z
Yes, we can consider this suggestion. 2 questions:

1) Why may you want to reject a filter?

2) Obviously you need to analyze the new filter criteria the user is going to apply. So you need a way to retrieve it. Most likely, it should be an instance of the iGFilterCriteria class you can retrieve with the iGColAutoFilter.GetFilterCriteria method.

How do you see the general scheme? Can you also show a concrete situation in which you need this functionality?
Maurizio Maiorino
2023-10-06T09:13:34Z
Thank you Igor for the feedback.
The concrete situation is as follows:
we have a Grid filled with data provided by a REST server.
In the 'code behind' we implement pagination, so the data exposed by the Grid is not all the data, but only one page (or some pages).
When the user wants to filter the data to focus on some issue (the Grid specifically exposes an alarm log), we need to intercept the filter and forward an 'update' request to the REST server.
At the moment we do this in the FilterApplied event and it works quite well...
The only effect is that the user sees the filtered data, but only those in the grid, and a few seconds later the grid changes, typically adding more rows (those that conform to the user's filter but reside on subsequent pages)

So, it is not a real problem, but if a FilterApplying event existed, we would prevent filtering, show a waiting spinner, call the server and then populate the grid and 'reapply' the filter, resulting in a more pleasant user experience.

Greetings

Maurizio
Igor/10Tec
2023-10-06T13:41:18Z
I've already heard about this scenario of AutoFilterManager usage, but there is one tricky problem related to this approach. The pick list in the filter box should show all unique values from the WHOLE data set. If you uploaded just a part of your data, then the user does not have the full list of items to check/uncheck for filtering. Actually you also need a way to provide AutoFilterManager with the full list of unique values. Obviously this should be a result of a special query to your database. What do you think about it?
Maurizio Maiorino
2023-10-19T09:09:10Z
You are right, we should provide a list of valid (global) values and yes, maybe with some (potential) extra queries.
Right now we are assuming that we are using filters on columns with a predefined set of values (such as states, types, ...), so the extra query overhead would be limited to some cached facilities provided by the code behind.
This does not eliminate the need to instruct the AutoFilterManager...