1 Attachment(s)
Re: DataGridView Combo box
a small trick you could work on...
(vs2008 and framework 3.5, but it should work on 2.0 too)
Re: DataGridView Combo box
WOW! It worked!
I had been struggling with this since yesterday.
You are great, man!
I would like to get your help on one more issue. I have an Image Column in the same datagridview, wherein, it displays one image when the displayed item in the combobox is "Pending" and another image when the displayed item in the combobox is "Done". I can't figure out how to go about it. I tried this
If grdRow.Cells("cb").Value = "Pending" Then
But it doesn't display any value.
Re: DataGridView Combo box
sorry, I am going on holidays...Value is there...look at combo selectedValue...
Re: DataGridView Combo box
I didn't find selected value.
Anyways, enjoy your holidays!
Re: DataGridView Combo box
What if you double-click on that column? That should give you a CLICK event or CHANGE event.
Re: DataGridView Combo box
here: add this code to the example, then launch it, then change a valuye in the combo and move to another column or row:
Code:
Private Sub grdExample_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grdExample.CellEndEdit
If e.ColumnIndex = grdExample.ColumnCount - 1 Then
MessageBox.Show("Here: value is " & grdExample.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)
End If
End Sub