Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i have 3 comboboxes that each of them selects special data. when i press on combobox1, it has 2 object! one is selected. according to this selection, i can select special data on combobox2 that is different with others! when i select on other value of combobox1, the values of combobox2 is deleted on combobox2.
i wrote:
C#
if (comboBox44.SelectedIndex == 0)
            {
                S_DRV_Byte26 = (byte)(S_DRV_Byte26 | 0x00);
                comboBox43.Items.RemoveAt(2); comboBox43.Items.RemoveAt(2);
            }
            else
            {
                S_DRV_Byte26 = (byte)(S_DRV_Byte26 & 0xff);comboBox43.Refresh();
            }

how can i refresh comboboxes to select from first?
Posted
Comments
Orcun Iyigun 11-Nov-13 2:35am    
Just to make sure? Can you please tell us if it is a WinForms, Web, WCF..etc?
mohsenvasefi 11-Nov-13 2:45am    
it's a winForm. in combobox44, when i select value 0, two data on combobox43 is removed! when select other value of combobox44, i need to comeback all of data
agent_kruger 11-Nov-13 5:57am    
i cannot figure out your question correctly .
But if you want to force the combobox to display data
write :- combobox1.Refresh()
mohsenvasefi 11-Nov-13 6:30am    
what about hide value on combobox instead of remove?
agent_kruger 11-Nov-13 6:49am    
how to hide values in combobox

Here is a link which explains how cascading combobox in c# works:
Cascading ComboBox In Winforms[^]

Good luck,,
OI
 
Share this answer
 
v2
yes you can by calling the second set of code at selectionCommitedchange of combobox
 
Share this answer
 
Comments
mohsenvasefi 11-Nov-13 8:28am    
no, it doesn't work well!
agent_kruger 11-Nov-13 8:30am    
how can you post the code
Orcun Iyigun 11-Nov-13 11:32am    
Use the "Improve solution" button or reply to his comment by using reply button!
agent_kruger 12-Nov-13 5:36am    
that's what i just did
Orcun Iyigun 12-Nov-13 9:36am    
No you didn't. Obviously you clicked to Add a solution. thats why you have 2 answers. If you clicked Improve button you would have a "v2" like on my answer. Just to show you I added extra comma after good luck to show it is done.

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