I have a ComboBox with its elements loaded from a sqlserver table (groups).
I also have a DataGridView, linked to another table (users).
When I load the form, the combo is filled with groups, and the datagridview is filled with users (all the users)
1) I want to be able to select a group from the ComboBox (dropDownList), and then to refresh the DataGridView with the users that belong to that selected group…
2) And How can I show a join relation in the DataGridView? Let’s say I want to show the groupName in the last column of the each user…
PS:
I have an xsd Dataset created in my VS2008 project with its
corresponding tableAdapters generated
(groupTableAdapter, userTableAdapter)
and some sql-methods added to each
adapter
1) Set up a BindingSource for both tables.
2) Set up your Combo and Grid DataSources.
3) Set up a SelectedIndexChanged event for the Combo and use it to change the filter on the bsUser bindingsource.
This worked fine… taken from here.
(Yes, I posted this also on MSDN because I was in a hurry)