I am using a DataGridViewCom boBox in a DataGridView. When a user selects a
radio button, I would like to clear all the items in the DataGridViewCom boBox
and repopulate with new values. I do this as follows:
It appears to do the job, but later while the control is refreshing i get the
error:
[COLOR="Red"]The following exception occured in the DataGridView:
System.Arguemen tException: DataGridViewCom boBoxCell value is not valid.
To replace this default dialog please handle the DataError event.[/COLOR]
Any ideas?
--
Message posted via DotNetMonster.c om
radio button, I would like to clear all the items in the DataGridViewCom boBox
and repopulate with new values. I do this as follows:
Code:
Dim iIndex As Integer
Dim dgcb As DataGridViewComboBoxCell
For iIndex = 0 To dgvRecipe.RowCount - 1
dgcb = dgvRecipe.Rows(iIndex).Cells("Measure")
dgcb.Items.Clear()
If radEnglish.Checked Then
dgcb.Items.AddRange(New String() {"t", "T", "Cup", "Quart",
"Gallon", "oz", "lbs"})
Else
dgcb.Items.AddRange(New String() {"mg", "g", "ml", "Litre"})
End If
Next iIndex
error:
[COLOR="Red"]The following exception occured in the DataGridView:
System.Arguemen tException: DataGridViewCom boBoxCell value is not valid.
To replace this default dialog please handle the DataError event.[/COLOR]
Any ideas?
--
Message posted via DotNetMonster.c om
Comment