I have a dataview (dv) that is the datasource of a datagrid.
I have a comboxbox with the fieldnames of the dataview (cboxColumnPicker)
I have a text box with the value i want to filter by (txtSearch)
I have tried:
dv.RowFilter = "[" & cboxColumnPicker.SelectedItem & "] LIKE '" & txtSearch.Text & "'"
However, this doesn't work with System.Int32, System.DateTime, etc datatypes. How can I test for all these various types and create an appropriate filter?
I was hoping to utilize the flexibility the LIKE statement, since I want people to be able to enter partial data. For example to type '%2005%' in the text box for a datetime column, and find all datetimes that are in the year 2005, and likewise "01/%" to find all the datetimes with a month of January.
Any help would be greatly appreciated.