|
-
Jun 28th, 2007, 04:32 AM
#1
Thread Starter
Frenzied Member
-
Jun 28th, 2007, 05:27 AM
#2
Re: [2005] combobox in datagridview, single click
In datagrid view the combox work on the single click event. I do not what are you doing there.
Have you set the item in the datagridview combo?
-
Jun 28th, 2007, 05:50 AM
#3
Thread Starter
Frenzied Member
Re: [2005] combobox in datagridview, single click
Hello,
I am not doing anything with the event of a cell being clicked.
I just want to select an item from the combo box. Currently it takes about 3 clicks to do this. 1 for activating the cell, 2nd for activating the combo box adn dropping it, and 3rd selecting the item.
I am wondering is there a way to cut down on the about of clicks that are needed.
Thanks,
-
Jun 28th, 2007, 05:56 AM
#4
Re: [2005] combobox in datagridview, single click
As we know that the datagridview is the parent of the cell combobox
so this will work from the parent to child
and this combination will be as
DataGridView -> DataGridViewRow -> DataGridViewcolumn
for more detail you can see the datagridview click event!
other wise it is batter to use a seperate combo for it!
-
Aug 23rd, 2007, 09:32 AM
#5
Addicted Member
Re: [2005] combobox in datagridview, single click
Try this, it works with 1 click:
vb Code:
Private Sub dgvReceiptItems_CellEnter( ByVal sender As Object, _
ByVal e As System.Windows.Forms.DataGridViewCellEventArgs ) _
Handles dgvReceiptItems.CellEnter
Dim dgv As DataGridView = CType(sender, DataGridView)
If dgv(e.ColumnIndex, e.RowIndex).EditType IsNot Nothing Then
If dgv(e.ColumnIndex, e.RowIndex).EditType.ToString() = "System.Windows.Forms.DataGridViewComboBoxEditingControl" Then
SendKeys.Send("{F4}")
End If
End If
End Sub
-
Aug 23rd, 2007, 11:19 AM
#6
Thread Starter
Frenzied Member
Re: [2005] combobox in datagridview, single click
There is a better way set the property EditMode to EditOnEnter
Thanks
-
Mar 14th, 2018, 07:47 AM
#7
New Member
Re: [2005] combobox in datagridview, single click
 Originally Posted by alex30
Try this, it works with 1 click:
vb Code:
Private Sub dgvReceiptItems_CellEnter( ByVal sender As Object, _
ByVal e As System.Windows.Forms.DataGridViewCellEventArgs ) _
Handles dgvReceiptItems.CellEnter
Dim dgv As DataGridView = CType(sender, DataGridView)
If dgv(e.ColumnIndex, e.RowIndex).EditType IsNot Nothing Then
If dgv(e.ColumnIndex, e.RowIndex).EditType.ToString() = "System.Windows.Forms.DataGridViewComboBoxEditingControl" Then
SendKeys.Send("{F4}")
End If
End If
End Sub
This helped much !!! (even after 10 years LOL)
 Originally Posted by steve_rm
There is a better way set the property EditMode to EditOnEnter
Thanks
This way with EditOnEnter works as well, but text in other cells can be easily changed after accidental key press.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|