Re: Simplify or filter data
You would use multiple DataViews for this. Every DataTable has a DefaultView and that is where the data comes from when you bind the DataTable itself. If you want multiple views of the same data though, you should create multiple DataViews explicitly. Add a BindingSource to your form for each DataGridView, create the DataViews in code, bind the DataViews to the BindingSources and the BindingSources to the DataGridViews. You then do the filtering and sorting via the BindingSources. E.g.
vb.net Code:
Dim table As New DataTable
Using adapter As New SqlDataAdapter("SELECT * FROM Person", "connection string here")
adapter.Fill(table)
End Using
Dim activeView As New DataView(table)
Dim inactiveView As New DataView(table)
activeBindingSource.Filter = "IsActive = True"
activeBindingSource.DataSource = activeView
activeDataGridView.DataSource = activeBindingSource
inactiveBindingSource.Filter = "IsActive = False"
inactiveBindingSource.DataSource = inactiveView
inactiveDataGridView.DataSource = inactiveBindingSource
That would display all the active records in one grid and the inactive records in the other. If you were to edit a DataRow in the DataTable, either via either grid or in code, you'd see it disappear from one grid and appear in the other, courtesy of the filters.