vb.net 2012 datagridview

The below code creates a column in a datagridview control in visual studio 2012 using vb.net.  The column does not respond to being clicked?  Is there additional code to have the column respond to being clicked?

            Dim cmb As New DataGridViewComboBoxColumn()
            cmb.HeaderText = "aSelectData"
            cmb.Name = "cmb"
            cmb.MaxDropDownItems = 2
            cmb.Items.Add("True")
            cmb.Items.Add("False")
            DataGridView1.Columns.Add(cmb)
dastaubAsked:
Who is Participating?
 
GanapathiConnect With a Mentor Facets DeveloperCommented:
Did you set the Enabled property of the DataGridView to True?
0
 
GanapathiFacets DeveloperCommented:
Are you trying to call a EventHandler on clicking the column?
0
 
dastaubAuthor Commented:
I am trying to get the drop down list to display when I click on the column.  currently the drop down box does not respond to any click.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
GanapathiFacets DeveloperCommented:
Set the IsPostBack property to True on DataGridView in page_load and try it.
0
 
dastaubAuthor Commented:
It is a windows form app not a web app
0
 
Jacques Bourgeois (James Burger)PresidentCommented:
There is a reaction when you click on a DataGridViewComboBoxColumn. It might simply be that this is not the one that you expect.

The first click selects the cell.
A second one triggers the dropdown.

This makes sense. Users might want to simply click in the row without necessarily seeing the content of the list. Or they might simply want to copy and paste the information that is there.

Maybe you would prefer it to open on the first click, but other users would find it annoying. In my opinion, same as for any application, it's simply question of know it and it becomes an habit.

This is a common mechanism in Windows. In Windows Explorer, a first click on a file name selects it, a second one triggers a rename.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.