views:

951

answers:

1

Hey Stackers,

I have two DataGridView's bound to an underlying DataSource through BindingSources and TableAdapaters.

I have two models; strings and tables. Tables -> [id, handle, description] Strings -> [id, handle, table_id]

So there's a many-to-one between Tables and Strings.

What's the easiest way to make the selection of the "tables" DataGridView to filter the contents of the "strings" DataGridView?

I understand the datasource of the "strings" DataGridView can be set to the bindingsource of the "tables" DataGridView but this does not support multiple selection.

At the moment, when the selection on the "tables" DataGridView is changed, I am iterating over the selected rows and building a string-based filter for the "strings" DataGridView but I find this slow and messy.

Anyone know a nicer way?

+1  A: 

You might have some other issue with the code that is making it slow.

About it being messy, I usually just move code that lets me easily grab lists of elements to extension methods over the DataGridView. Built-in/simple is for single selection.

eglasius