When a header filter is used for a column and its FilterMode is set to “DisplayText”, the predefined “(Blanks)” criterion returns rows with values equal to null or empty, whereas in a grid’s Filter Bar the “Is blank” condition will not return anything.
This can be described by the fact that in the former case, the resultant CriteriaOperator will be built as “IsNullOrEmpty”, while in the latter case it will be “IsNull”. In order to make Filter Bar work in the same way, it’s possible to parse its filter expression and replace IsNull operator with the required IsNullOrEmpty.
This example uses a parsing technique demonstrated in E3396: How to delete all criteria corresponding to a particular field from CriteriaOperator. In this case, the CriteriaHelper class was slightly modified so that the UnaryOperator of type IsNull is replaced by the FunctionOperator of type IsNullOrEmpty.
The modified filter expression is applied on a grid’s callback.