Click here to Skip to main content
15,907,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How Can I binding data from Sql DB in combo box and make relation between 2 combo boxes ... I mean that one combo box members depends on which selected on the other combo box for example country and citities when i select country from first combo box appears only (citities of this country on the second combo box) using c# Windows application ... best regards
Posted
Updated 4-Mar-15 23:41pm
v2

1 solution

For the first combobox you normally get the data and bind it to the combobox. You bind the other one in SelectedValueChanged event of the first one in which you get the data for the second depending on SelectedValue of the first.

If this helps please take time to accept the solution. Thank you.
 
Share this answer
 
Comments
Mohamed-Hmy 8-Mar-15 6:09am    
that's ok ... but what about coding ??
Can You Give Me Example ??
best regards
Sinisa Hajnal 9-Mar-15 4:53am    
You do know how to bind the combobox, right? What have you tried? I've described the process and if you know how to bind the data then you just have to use SelectedValueChanged event. If you're looking for a free code, you're in a wrong place. If you need help with binding the combobox, you should have phrased your question differently. And there are plenty of examples easily found via google. Please describe exactly what you need...and why. Thank you.

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