By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,542 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

how to edit text in a combobox

P: 51
hi,

I have a combobox which has dropdown style set to "dropdownlist"(since i dont want the element getting populated in the combobox to be edited).

Apart from populating the comboxbox from items form the file am giving an extra item "New" which should allow the user to add new element.

but the problem which i come across is since the dropdown list dont allow th user to edit the text am not able to edit nethng.

So could anyone tell me how to make tht particular text enable on index change

thanx
Jan 21 '09 #1
Share this Question
Share on Google+
4 Replies


Frinavale
Expert Mod 5K+
P: 9,731
Have you tried to implemented a method to handle the SelectedIndexChanged Event which enables the TextBox?
Jan 27 '09 #2

P: 51
i tried but i couldn't enable it..
Jan 28 '09 #3

tlhintoq
Expert 2.5K+
P: 3,525
If the problem is that you can't edit text while the style is DropDownList, but the text IS editable when the style is DropDown.... then change the style back to DropDown when the user selects the 'New' option.

Expand|Select|Wrap|Line Numbers
  1. ((ComboBox)sender).DropDownStyle = ComboBoxStyle.DropDown;
  2.  
Then when the focus leaves that control, change the style back to DropDownList.
Jan 28 '09 #4

P: 51
thanx a lot buddy ..it worked :)
Jan 29 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.