3

I'm using a BindingSource connected to a DataGridView to filter the data shown.

I would like to know what is the best way to get the filtered result to some other thing than a GridView?

I ask this as I would like to use the filtered result for a few ComboBoxes. Right now I populate these by the DataTable that gets filtered by the BindingSource.

So in short, how do I get filtered BindingSource result as source for something else than a DataGridView?

Jonas Lindahl
  • 752
  • 10
  • 24

1 Answers1

4

Actually I believe I finally found a solution.

sourceDataTable.DefaultView.RowFilter = bindingSource.Filter;
DataTable destinationDataTable = sourceDataTable.DefaultView.ToTable();
Jonas Lindahl
  • 752
  • 10
  • 24