Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

vb.net 2012 datagridview

Posted on 2014-04-27
6
Medium Priority
?
510 Views
Last Modified: 2014-04-27
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)
0
Comment
Question by:dastaub
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:Ganapathi
ID: 40025592
Are you trying to call a EventHandler on clicking the column?
0
 

Author Comment

by:dastaub
ID: 40025715
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
 
LVL 8

Expert Comment

by:Ganapathi
ID: 40025740
Set the IsPostBack property to True on DataGridView in page_load and try it.
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

Author Comment

by:dastaub
ID: 40025750
It is a windows form app not a web app
0
 
LVL 8

Accepted Solution

by:
Ganapathi earned 2000 total points
ID: 40025809
Did you set the Enabled property of the DataGridView to True?
0
 
LVL 40
ID: 40025955
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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

810 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