I have adapted the filtering example on the below link so it works with a DataRow instead of an Object
https://help.syncfusion.com/windowsforms/multicolumn-combobox/multiple-columns
Here is the adapted code
Public Function FilterRecords(ByVal o As Object) As Boolean
Dim item = TryCast(o, DataRow)
If item IsNot Nothing Then
Dim codeColumn As DataColumn = item.Table.Columns("code")
Dim nameColumn As DataColumn = item.Table.Columns("name")
If codeColumn IsNot Nothing AndAlso nameColumn IsNot Nothing Then
Dim codeValue As String = item(codeColumn).ToString()
Dim nameValue As String = item(nameColumn).ToString()
If codeValue.IndexOf(myText, StringComparison.OrdinalIgnoreCase) >= 0 OrElse
nameValue.IndexOf(myText, StringComparison.OrdinalIgnoreCase) >= 0 Then
Return True
End If
End If
End If
Return False
End Function
When assigned to the Filter property as follows, I get an error
Private Sub Cmb_TextChanged(sender As Object, e As EventArgs) Handles Cmb.TextChanged
Cmb.Filter = FilterRecords() // This line has the error - it automatically adds the brackets and I get an "Argument not specified for parameter 'o'..."
End Sub
Is there an example I can download so I can see how to properly implement this method?