Home Forums WinForms controls Xceed Grid for WinForms Filter on a DataSet Reply To: Filter on a DataSet

User (Old forums)
Member
Post count: 23064

I don’t think you should set a RowFilter on the DefaultView of a table. Instead, create a new DataView on top of the table, and set the DataSource of your grid to this view.<code>Dim dvFilteredView As DataView = New DataView(dsSource.Tables(“myTable”))
myGrid.DataSource = dvFilteredView
Private Sub FilterIntoDataGrid(ByVal strSearch As String)
myGrid.BeginInit()
Try
dvFilteredView.RowFilter = strSearch
Catch ex As Exception
dvFilteredView.RowFilter = String.Empty
Finally
myGrid.EndInit()
End Try
End Sub</code>

Imported from legacy forums. Posted by Tommy (had 3084 views)