|
-
February 26th, 2010, 12:40 PM
#1
[RESOLVED] DataGridViewComboBox event
I have a DGV with a CB column in VS2008. I would like an event when a DGVCB selection is made (without leaving the cell). It will probably have to be a DGV cell or row event but I can't find one that fires as soon as a DGVCB selection is made. thx
-
February 27th, 2010, 02:29 AM
#2
Re: DataGridViewComboBox event
One way of achieving the same is as below:
Code:
Public Class Form1
Dim WithEvents MyCbo As ComboBox
Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing
If TypeOf e.Control Is ComboBox Then
MyCbo = DirectCast(e.Control, ComboBox)
End If
End Sub
Private Sub MyCbo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyCbo.SelectedIndexChanged
MsgBox(MyCbo.Items(MyCbo.SelectedIndex))
End Sub
End Class
Working fine in VB.Net 2005 and framework 2.0.
It should work in VS2008 also.
Good luck
Encourage the efforts of fellow members by rating
Lets not Spoon Feed and create pool of lazy programmers
- ComIT Solutions
-
March 4th, 2010, 03:07 PM
#3
Re: DataGridViewComboBox event
-
March 5th, 2010, 03:00 AM
#4
Re: DataGridViewComboBox event
 Originally Posted by Mur16
Peerrrrfect. thx
If you got what you were looking for,mark this thread as resolved.
Encourage the efforts of fellow members by rating
Lets not Spoon Feed and create pool of lazy programmers
- ComIT Solutions
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
|