I want to combine a rowfilter combination on 2 columns. One column is a checkbox - show only rows that are checked and at the same time also apply a text filter on another column (string). I can do each one individually but I can't seem to get a handle on the proper syntax to combine the 2 into 1 filter.
What I have tried:
My DataGridView has 2 different columns on which I apply rowfilter:
1) Checkbox Column (Call it "S")
2) Regular String Column (Call it "Artist")
3) DataTable (Call it "DT")
4) DataGridView (Call it "DGV")
and they are bound
DGV.Datasource=DT
dt.defaultview.rowfilter = "S"
dt.defaultview.rowfilter = String.format("{0} LIKE '{1}'", "Artist", strA)
dt.defaultview.rowfilter = "S" And String.format("{0} LIKE '{1}'", "Artist", strA)
doesn't work, I get an invalid cast exception
Conversion from string "S" to type 'Long' is not valid.
checkbox one is a boolean ("S") and the other is essentially a string
Any know the proper syntax to get this combination to work together?