4

I am not a .net programmer but I can write bits and pieces that I need, however, I have been having trouble working out the best way to achieve something for a website I'm altering. I basically need to have a drop down list which is bound to a certain SQL call (already in place) but I also need the ability to manually type into the drop down list for items that do not exist. These items do not need to be entered into the SQL (I can handle the additional data separately) but I cannot find a way to type inside a drop down list while it is bound to a datasource. Some entries in the datasource (SQL table) are used for one thing, but then a text string needs to be entered for optional entries which do not exist within this SQL table.

Does anyone know how I can achieve this or maybe another similar control can be used that offers this kind of functionality?

**Update to be more clear: I need this at runtime. For instance, I do not need this to be within code I actually need the control to accept user input when someone is on the webpate. Imagine a shopping list and all the items are within the drop down list then the user wants to add another item to the shopping list so they just type it into the drop down box and submit the page and its value will be used instead of an existing item.

kaotix
  • 43
  • 2
  • 7
  • 1
    Telerik combobox will do that and a lot more ... I dont know if you can invest ... but they are worth the $$$ – David Aug 16 '11 at 20:14

1 Answers1

3

As suggested by David, Telerik ComboBox provides that functionality. Other ways, to use an ASP.NET and jQuery for implementing that functionality.
Using TextBox permits manual entry and using jQuery UI AutoComplete widget to bind required items.

jQuery Autocomplete and ASP.NET
TextBox AutoComplete with ASP.NET and jQuery UI
3 Different Approaches for Implementing the JQuery Autocomplete with ASP.NET

Community
  • 1
  • 1
Ahmed Atia
  • 17,848
  • 25
  • 91
  • 133