I have a "generic" search dialog that I am able to fill a datatable with two columns for searching. These two
columns may be different types from Integer to String to DateTime
There is one textbox for entering a search term. How would I format the DataTable's RowFilter according to the
text entered based on the types of the two columns in the datatable?
Currently, we have it like the code below and it is causing problems when the first column is an Integer column.
The objColl is a collection with an ISearchableWrapper interface that returns the NAME of the particular column in
e and SearchDesc_DataPropertyNam
e properties. The items in the collection are
what is loaded into the DataTable.
Any ideas on how I should approach this? Have you done something like this before?
Private Sub txtFilter_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtFilter.TextChanged
If Me.tbl IsNot Nothing Then
Me.tbl.DefaultView.RowFilter = Me.objColl.SearchItem_DataPropertyName & " like '" & Me.txtFilter.Text & "%' OR " &
Me.objColl.SearchDesc_DataPropertyName & " like '" & Me.txtFilter.Text & "%'"