vb net DataGridView ComboBox will not drop down

Posted on 2011-10-27
Last Modified: 2012-05-12
I am using 2005.
I have a DataGridView with several columns. One of the columns is a ComboBox. What I want to happen is when I populate the DataGridView by binding it with the DataTable I want the ComboBox item that is in the DataTable field to be the one that is shown as selected in the drop down. Then if the user wants to change the value they select a different one from the DropDown (and I will perform some update action). My code displays the correct DataTable item in the ComboBox, but the ComboBox will not drop down so a different item can be selected. What am I doing wrong? Here is the code.

This is the code where I set up the ComboBox in the Form_Load and add all the possible items that can be in the DataTable field.

c10 = New DataGridViewComboBoxColumn
        c10.Name = "Destination"
        c10.DataPropertyName = "Destination"
        c10.MaxDropDownItems = 5
        c10.Items.Add(" ")
        c10.Items.Add("Dane Or Auto")
        c10.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton
        ' So you only have to click the ComboBox one time to get it to dropdown
        Me.dgvQueue.EditMode = DataGridViewEditMode.EditOnEnter

       dgvQueue.AutoGenerateColumns = False

Open in new window

I then bind the DataGridView to my DataTable and everything populates. The ComboBox column shows the correctly selected item (the value of the Destination field that is in the DataTable), but when I click the drop down arrow nothing happens - it will not drop down to display the values I loaded in the form_load. How do I fix this?
Question by:sqdperu
    LVL 83

    Accepted Solution

    Is the grid set to allow edits?

    Author Comment


    You are correct.  I had a copy of a program that I was using to test with and had each columns ReadOnly property set individually as appropriate.  I had thought about that.  So to fix I had to set the ComboBox column to ReadOnly  = False like this:

    dgvQueue.Columns(9).ReadOnly = False

    Thanks for the help

    Author Comment

    Oops, forgot to add.  The grid itself was set tor ReadOnly = False.  So I was alright there.  It is at the individual cell level where I had it locked down.  Thanks.
    LVL 83

    Expert Comment

    Glad to help :-)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    728 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

    25 Experts available now in Live!

    Get 1:1 Help Now