Hello all. I have a programming issue with the truedbgrid filterbar. I have a custom search function tacked on to my grid so that I can search for numbers and words. That function is below. When I load my form is set the grid.FilterActive = True. When I start typing I get the following error "Missing operand before 'Like’ operator. The error comes from my custom filter function. The function works perfectly when I click on the filterbar and start typing but not when I set filteractive to true and start typing.
Dim sb As New System.Text.StringBuilder() Dim dc As C1.Win.C1TrueDBGrid.C1DataColumn For Each dc In _grid.Columns If dc.FilterText.Length > 0 Then Select Case dc.DataType.Name Case "String" If sb.Length > 0 Then sb.Append(" AND ") End If sb.Append((dc.DataField + " like " + "’*" + dc.FilterText.ToString + "*’")) Case "Int32", "Double", "Single" If sb.Length > 0 Then sb.Append(" AND ") End If sb.Append((dc.DataField + " = " + dc.FilterText.ToString)) Case Else 'dc.FilterText = "" 'TODO add other data types End Select End If Next dc ' filter the data Me.DT.DefaultView.RowFilter = sb.ToString