In VB 2005 Express I have a problem, which completely do not understand. I use a DataGridViewComboBox in a DataGridView. When I change data and save it, I have no problem. But when I close the form I a repeting error, being: System.ArgumentException: DataGridViewComboBoxCell value is not valid.
Can anybody help
Thanks in advance,
Simon

Problem with value DataGridViewComboBoxCell
max_08
My data is coming from a table and the display member and value member are different fields.
But now it has become even more strange. I don't know what I changed, but the error is gone. So for now I'm OK, but when it happens again, I don't know how to solve this.
Regards,
Simon
Blake Bishop
dsinay
Thanks for the workaround.
I don't mind filing a bug, but where can I do that. When VBE was still beta there where some links to bugs and suggestion forums, but I can't find those anymore.
Regards,
Simon
jordan kaliher
Does the data you saved exist in the DataGridViewComboBoxCell's items list
For instance, if your DataGridViewComboBoxCell::Items collection is {"one", "two", "three" } and the value you saved is "four" then you will get this error.
Another situation is if your DataGridViewComboBoxCell is data bound. For example sake, say that the ComboBox displays data from a DataTable, say it displays data from the DataColumn "Number". If the DataColumn contains "one", "two", and "three" and the value you saved is "four" then you will also get this error.
Hope this helps,
Daniel.
Dinesh Asanka
I have solved it by deleting the DGV and created a new one, with the same combobox. Since then I didn't have the issue anymore.
Jens Hibbeler
That sounds resonable. But I receive the error while closing the form.
Simon
Sanjuz
Right now I'd say that you'll want to remove the autosizing in the grid's dispose event or in the form's closing event. < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Can you file a bug for this This will help us identify what is going on here.
thanks,
-mark
DataGridView Program Manager
Microsoft
This post is provided "as-is"
stoneyowl
Any suggestions
Regards,
Simon
ETopGun
Regards,
Simon
Fiofio38
Set the autosize mode after you fill the combo box and things should be ok.
-mark
DataGridView Program Manager
Microsoft
This post is provided "as-is"
e-an
If you have a sample app can you post it here Also, can you post what value you save the combobox to
Thanks,
Daniel.
Abu14166
bbakermai
I found a work around. If I take out the databindings for the grid before closing the form I don't get the error.
Me.dgvStoreVisit.DataSource = Nothing
Me.Close()
Vincent Reynolds
Use the following link: http://lab.msdn.microsoft.com/productfeedback/Default.aspx < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
-mark
DataGridView Program Manager
Microsoft
This post is provided "as-is"