Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > datagridviewcombobox dropdown at first click
 

datagridviewcombobox dropdown at first click

how can I get a combobox in a datagridview to show the dropdown list without clicking it twice. First click to select the control, second click to dropdown.

I've seen the use of:

SendKeys.Send("{F4}");

But this is not wat I want. I'm developing software for business clients, who might use antivirus software or antispyware. These will respond to the use of sendkey as keyboard monitoring software (spyware). So I have to find an other way to accomplish this.

Does anyone know how?

smeets116  Wednesday, June 07, 2006 8:53 AM

Hi,

 

I'm not familair with the datagridview or dggridviewcolumn, but maybe you can check the onmousedown event and set the drowpdown property

eg

Private Sub comboMousedown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Hostedcombo.MouseDown

if Hostedcombo.DroppedDown = false then  Hostedcombo.DroppedDown= true

End Sub

Remco

RemcoJVG  Wednesday, June 07, 2006 9:45 AM

Sorry, but I'm not familiar with VB, I chose for C#. Since I don't understand the code you wrote, I can't recreate it in C#.

Thanks

smeets116  Friday, June 09, 2006 1:03 PM

C# code is verry simular, but the general idea is :

have a reference to the hosted combobox

Catch the mousedown event with a eventhandler, in the eventhandler check if the combobox is dropped down if it's not dropped down then then drop it down in code.

but like a said i'm not familiair with the dgvieuw so it might not be possible, maybe somebody els can chime in.

Remco

 

RemcoJVG  Monday, June 12, 2006 1:21 PM

You can use google to search for other answers

Custom Search

More Threads

• Checked Status DataGridViewCheckBox
• datagridcomboboxcolumn is not update the bindsource datagridview
• Binding a business object to a dataset
• How to add DbParameterCollection to a command
• row error
• Matrix transformation and common sense
• Creating an INSERT query in DataSet Designer fails; bug?
• How do I display specific numbers of rows at a time in a DataGridView?
• Best way to display large datasets?
• DataGridView ComboBoxColumn Style