i am facing a problem in setting the combo property such that only user can select the values form given items but cannot write in the combo box,
how can i do so in c#?
thanx in advance.
i am facing a problem in setting the combo property such that only user can select the values form given items but cannot write in the combo box,
how can i do so in c#?
thanx in advance.
Just change the DropDownStyle
to DropDownList
. Or if you want it completely read only you can set Enabled = false
, or if you don't like the look of that I sometimes have two controls, one readonly textbox and one combobox and then hide the combo and show the textbox if it should be completely readonly and vice versa.
I think what you want to do is to change the setting called "DropDownStyle" to be "DropDownList".
This question has been asked before.
Please see here : http://stackoverflow.com/questions/85702/how-can-i-make-a-combobox-non-editable-in-net
Solution is to change DropDownStyle Property to DropDownList. It will help