Not sure if it's your problem (you could've been more specific, like what's the
Exception[
^] message and where is it thrown...), but setting a
DataSource[
^] to
Nothing
usually doesn't work.
Imagine this, when binding takes place a data bound object looks in the objects in its
DataSource Property
to find the values of the
ValueMember[
^] and
DisplayMember[
^] Properties. It does this using
Reflection[
^]. Now when you tell your data bound object that its
DataSource
is
Nothing
it will check for the
ValueMember
and
DisplayMember
on
Nothing
. That is just silly because
Nothing
doesn't have any members at all! In fact,
Nothing
is just that, nothing.
So instead of doing the following:
DirectCast(dgvSales.CurrentRow.Cells(2), DataGridViewComboBoxCell).DataSource = Nothing
Try this:
DirectCast(dgvSales.CurrentRow.Cells(2), DataGridViewComboBoxCell).DataSource = New List(Of QtyObject)
Hope it helps :)