Click here to Skip to main content
15,912,977 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a Windows Form custom comboBox that I'm hosting in a dataGridView. I can't figure out how to keep the drop down list open while the user selects items. There is no closing event to hook off of. Does anyone know how this is accomplished? I would appreciate any advice.

Thanks in advance,
-DA
Posted
Comments
Sergey Alexandrovich Kryukov 30-Oct-13 1:26am    
Donald,

You asked 135 questions, and I believe many have been removed. By this time, you could understand that you need to tag your UI library/framework or application type when UI is concerned. In this case one can guess, by the name "DataGridView", that this is System.Windows.Forms, but why guessing?

And it's not clear what do you mean by "open" or "close" combo box...

—SA
d.allen101 30-Oct-13 1:29am    
I understand

1 solution

Assuming your custom ComboBox inherits from the WinForms native ComboBox:

Putting this in the SelectedIndexChanged EventHandler:
if(! comboBox1.DroppedDown) comboBox1.DroppedDown = true;
Will force the DropDown to stay dropped until you either click in the selection text display area of the ComboBox, or you click outside the ComboBox so that the ComboBox loses Focus.

Are you doing something that implements multi-selection ?
 
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