Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai i have a probleam with my combo box.For your info i have 4 combox box which bound to database. The probleam is if i choose one of the list item in 1st combo box then other second, third and forth combox box will display the same item. This is cause me a probleam because i am creating form for calculate price item. First combo box must have different item list from second, third and forth.For your info too all this combo box is connected to 1 table with column item name. Please advice or show me how i can make that if i choose one item list in first combo box then second , third and forth combo box can display with different list item .I need to solve this issue
Posted
Updated 19-Oct-11 13:55pm
v2

1 solution

It seems that you are not handling the change event properly.
From your description of the problem above, please try to make sure the following points.

1. All the four combo boxes have different names in context of their Identity and Event Handlers (Selected Index Changed)

2. Make sure that you are not performing any inter-connected selection index changing process while selecting items from any combo box. What does this mean is when you handle the selected index changed event for the combo box 1, it does not have anything which changes combo box 2, 3 and 4

To achieve your goal;
What I would do is;

1. Load all the combo boxes with the item names from the table.

2. Keep the item names (DataTable) in either a session variable or a global variable

3. On selected index changed property of combo box 1, I load the combo box 2, 3, 4 with all the items from the session or global variable, then iterate through all the items and remove the item which is selected in combo box 1

4. I would do the step 3 for combo box 2 and 3

This way, all the items would be different in combo box 1, 2 3 and 4

Happy coding :)
 
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