A
alex
I have a datagridview with datagridviewcomboboxcolumn bind to a nullable
integer datatable field
When I add a new row I can do it without select any item on combo and the
NULL value in inserted on the datatable
But if I select an Item than there is no way to unselect it and choose null
Even I if use ctrl+0 null text is passed to the combo, but then I get a
commit error
I've tryed with this but is not really a nice solution
Private Sub DataGridView_dettaglio_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles DataGridView_dettaglio.KeyUp
If e.KeyCode = Keys.Delete And
Me.DataGridView_dettaglio.CurrentCell.ReadOnly = False Then
' delete the entry by giving the cell the value dbnull
Me.DataGridView_dettaglio.CurrentCell.Value = DBNull.Value
End If
End Sub
How can I do it?
Thank you
Alessandro
integer datatable field
When I add a new row I can do it without select any item on combo and the
NULL value in inserted on the datatable
But if I select an Item than there is no way to unselect it and choose null
Even I if use ctrl+0 null text is passed to the combo, but then I get a
commit error
I've tryed with this but is not really a nice solution
Private Sub DataGridView_dettaglio_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles DataGridView_dettaglio.KeyUp
If e.KeyCode = Keys.Delete And
Me.DataGridView_dettaglio.CurrentCell.ReadOnly = False Then
' delete the entry by giving the cell the value dbnull
Me.DataGridView_dettaglio.CurrentCell.Value = DBNull.Value
End If
End Sub
How can I do it?
Thank you
Alessandro