0

how can i Add to dropdown list duing runtime in visual studio.Suppose i have 4 list items in drop down and one of the option is to add a new item.What i want to do is when i select that option(create new) i should be able to add the fifth option in the list.

Thanks

4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by sdhawan
0

how can i Add to dropdown list duing runtime in visual studio.Suppose i have 4 list items in drop down and one of the option is to add a new item.What i want to do is when i select that option(create new) i should be able to add the fifth option in the list.

Thanks

Hello,

First setup a textbox (for the item to be added), then a button to add it.

when clicking the button type

combobox1.Add.Items(textbox1.text)
0

almost had it.

combobox1.Items.Add(textbox1.text);

doh, thanks for that. I'm still learning :)

0

Thanks for the reply guys.What i am trying to do is user can add to the drop down liast and that drop down list should then be inserted in the databse under the category column.so suppose i have list item as ...add, animal , buildings, now if the user click on add list item he should be able to enter new list item and at the same time should be able to insert it in databse.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.