I have a DataGridView on a form that is being populated from a SQL table dataset by giving criteria from a previous form. I have 6 columns in the dataset, of which the last column should be combo box column containing items "Done" and "Pending". How do I make this bound column to a combo box column and display the value as well as the alternate item too in the combo box?
(vs2008 and framework 3.5, but it should work on 2.0 too)
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
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
sorry, I am going on holidays...Value is there...look at combo selectedValue...
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
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
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.