I found an error at the time of double click in cell gridview because there is a blank or empty record in the DTE column and qty column. Is there the best solution or recommendation? note : I use visual studio 2010
Private Sub DataGridView1_CellDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellDoubleClick
x = DataGridView1.Rows.IndexOf(DataGridView1.CurrentRow)
txtCODE.Text = DataGridView1.Rows(x).Cells(0).Value.ToString()
Dim cellValue = DataGridView1.Rows(x).Cells(1).Value
DateTimePicker1.Value = CDate(If(cellValue Is Nothing OrElse cellValue Is DBNull.Value, String.Empty, cellValue.ToString()))
Dim cellValue1 = DataGridView1.Rows(x).Cells(2).Value
NumericUpDown1.Value = CDec(If(cellValue1 Is Nothing OrElse cellValue1 Is DBNull.Value, String.Empty, cellValue1.ToString()))
End Sub