Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi.....
I use more than one combo box in my project
my problem is when i select one value in one combo box than all combo box value is automatically selected same.but i select diffrent value in all combo box.
how to select diffrent value in my all combo box ?
how to solve it?
I use same data source in all combo
Please reply......
Posted
Updated 11-Sep-15 20:06pm
v3
Comments
DamithSL 12-Sep-15 1:04am    
update the question with the code which bind data to combo boxes

1 solution

The requirement sounds a bit odd since if all of the combo boxes follow the selection of one combo box, what is the purpose of the other combo boxes....

Anyhow you didn't mention what UI technology you use but if this is for example Forms, you would wire SelectedIndexChanged[^] event and in that event handler you would set the SelectedIndex[^] property for the other combo boxes.

For example
C#
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) {
   this.comboBox2.SelectedIndex = this.comboBox1.SelectedIndex;
}

The basic idea is the same also with other UI technologies.
 
Share this answer
 
v2

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