Hello and thank you for the code example. But I need some more help implementing that code.
I am trying to to filter two columns with an OR operation.
Let's assume the following GridView:
Row1 x x
Row2 y z
When my search array contains ("x", "y") I expect as result set Row1 and Row2.
Your code works fine when filtering/searching only one column.
For filtering two columns I tried following code, which does not work properly:
Dim fe As New FilterExpression
Dim fe1 As New FilterExpression
Dim i As Integer
If ary.Length > 0 Then
For i = 0 To UBound(ary)
fe.Predicates.Add(FilterExpression.BinaryOperation.OR, GridKnownFunction.Contains, ary(i))
fe1.Predicates.Add(FilterExpression.BinaryOperation.OR, GridKnownFunction.Contains, ary(i))
Me.gvMessages.Columns("ResolvedValue").Filter = fe
Me.gvMessages.Columns("MessageValue").Filter = fe1
The result for search array ("x","y") is just Row1, because value "x" is in both columns.
fe and fe1 seem to be connected with an AND operation. What I need is an OR operation.
Maybe it is not possible to do what I like by default. In that case I need another approach, like iterating through all cells and highlight the found text or mark the cell with another background color or something like that.
Maybe you have another idea?