Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have three tables. One has two columns of which one column is bound with a ComboBox. Other two tables are bound with two separate DataGridViews but are related to the first table so that they both have a secondary key which matches up with the ID column(first column) of the first table(so that rows displayed in DataGridViews have the same secondary key value as the ID of the first table row currently selected). This works by using the menu generated by Visual Studio itself with the other components but I want this functionality in the ComboBox so that when I select an item from it, the corresponding rows should be displayed in the DataGridViews. How do I do it?
Thanks in advance.
Posted

Handle the onchange event of the combobox (events are listed on the tab in the properties window)
Get the selected item from the combobox
Apply a filter to the collection populating the DGVs.
 
Share this answer
 
Comments
Anas Tasadduq 9-Jun-14 0:11am    
How to apply that filter and where? And how to use the selected item got from the ComboBox in the filter?
Handle the onChange event of ComboBox and get the selected id and value of Combo Box. Now pass this id to your function for filtering the record at last bind the combo box with ur function.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900