What I do in these situations is create a Dataview from the default view of the datatable then set the datasource of the bindingsource to the DV then bind the dgv to the bindingsource. At which point you can iterate through all of the columns and find any string value within any string type column in the table
Code:Private Sub TB_VendorKeyUp(sender As Object, e As KeyEventArgs) Dim FilterString As String = Nothing Dim tb As TextBox = CType(sender, TextBox) If tb.Text.Length > 0 Then For Each col As DataColumn In DSET.Tables("VendorLookup").Columns If col.DataType = GetType(System.String) Then FilterString &= col.ColumnName & " LIKE '%" & tb.Text & "%' or " End If Next FilterString = FilterString.Substring(0, FilterString.Length - 4) VendorLookupDV.RowFilter = FilterString FilterString = Nothing End If End Sub




Reply With Quote
