ComboBox with boundlist, need to accept text that isn't in the list

Posted on 2005-04-14
Last Modified: 2010-04-23
I have a combobox whose value and display member are bound to a dataset column... I don't want to constrict the text to the list... in other words, even though the list is bound, i want to allow the user to type in something not in the list (i'm not worried about updating the list in the database, I just need to ensure that the if the user types something not in the list it doesn't get reset when the control looses focus.
Question by:majnun
    LVL 25

    Accepted Solution

    I don't think you can do that with a databound combobox.

    The only option you have (according to me) is not to bind the combobox, but to fill it manually (in code)
    LVL 25

    Expert Comment

    Or you could try to add the item to the actual table that is bound to the combobox

    Author Comment


    I suppose I can manually loop thru the bound dataset and set the items row by row... it just seems like a lot of work...

    I was hoping there was an easy way to reproduce the LimitToList functionality of a bound combobox in Access.

    Anyone else have any ideas?
    LVL 3

    Assisted Solution


            For Each drLine As DataRow In dsData.Tables("LIST").Rows

    If you don't need to add the new value to the original bounded table this should be all you need.
    LVL 12

    Assisted Solution

    I suppose an alternative to not having to loop thru and add manually would be to have two radio/option buttons... one paired off with your bound combo box... the other with an ordinary textbox...then the user has the option of selection from a pre-defined list (you may as well set it's dropdownstyle to DropDownList since you're not worried about text entry on this one)... or selecting the other option which gives access to a textbox where they can add their own entry

    Author Comment

    Thank you all for your suggestions... not what I was hoping to hear, but definately workable. Thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now