MultiColumnComboBox - Error on filtering example

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?





1 Reply

MJ Madhumithan Jayapathi Syncfusion Team October 5, 2023 01:20 PM UTC

Hi Bill,


We have validated your query and this issue you are getting can be address by adding Address of FilterRecords instead of FilterRecords(). We have attached a sample for your reference and please let us know if you need any further assistance.


Regards,

Madhumithan Jayapathi


Attachment: MultiColumnComboBoxVB_476d5104.zip

Loader.
Up arrow icon