Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DataGridView 2.0
 

DataGridView 2.0

I Added a TextBox Column and Then a ComboBox at The Right Side of That Column to My DataGridView 2.0
The Problem is That The CellValueChanged Event Does Not Raise For ComboBox Cells.
Do You Have The Same Problem?
Thanks

Amir .E.K  Saturday, August 18, 2007 4:20 PM

Hi,you need to handle the EditingControlShowing event on the DataGridView control.

please check following method

Code Snippet

Private Sub DataGridView1_EditingControlShowing(ByVal sender As System.Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing

Dim editingComboBox As ComboBox = e.Control
AddHandler editingComboBox.SelectedIndexChanged, AddressOf Me.editingComboBox_SelectedIndexChanged

End Sub
Private Sub editingComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

End Sub

For more information, please check following link

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=54048&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1801363&SiteID=1
Gavin Jin - MSFT  Wednesday, August 22, 2007 8:05 AM
Try to use the CellEndEdit event instead

Tamirro  Wednesday, August 22, 2007 7:41 AM

Hi,you need to handle the EditingControlShowing event on the DataGridView control.

please check following method

Code Snippet

Private Sub DataGridView1_EditingControlShowing(ByVal sender As System.Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing

Dim editingComboBox As ComboBox = e.Control
AddHandler editingComboBox.SelectedIndexChanged, AddressOf Me.editingComboBox_SelectedIndexChanged

End Sub
Private Sub editingComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

End Sub

For more information, please check following link

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=54048&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1801363&SiteID=1
Gavin Jin - MSFT  Wednesday, August 22, 2007 8:05 AM

You can use google to search for other answers

Custom Search

More Threads

• Combobox in DataGridView Cell problem
• How to assign an image to a PictureBox dynamically ?
• datagrid slow refresh
• Clear the data in the datagridview on button click
• Error on CellValidating()
• Noob Related record Question
• Still problems inserting dates in DB
• ADO.NET Can't Update Date or Number Null from Text
• serious problem with BindingManagerBase and its definitly a bug
• Adding data to column of type ComboBox in a DataGridView