By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,982 Members | 1,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,982 IT Pros & Developers. It's quick & easy.

datagridviewcomboboxcell value is not valid

P: n/a
I apparently have no idea what I am doing. ;o(

I have a datagridview bound to a dataset. I want to make one of the columns
a combobox that displays a list of choices I have in another table. When the
user clicks on that combobox, it should display those choices, allow them to
chose one, then when the save the data, it is saved into the table the
datagrid is bound too.

When I change the column to a combobox and set its datasource to the other
table and the datamember to the field in that other table, then run it, I get
the error above.

I know I am doing something wrong but not sure what it is. Any help would be
appreciated. I hope I have given enough info.

Jan 30 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jan 30, 8:43 pm, Chris <C...@discussions.microsoft.comwrote:
I apparently have no idea what I am doing. ;o(

I have a datagridview bound to a dataset. I want to make one of the columns
a combobox that displays a list of choices I have in another table. When the
user clicks on that combobox, it should display those choices, allow them to
chose one, then when the save the data, it is saved into the table the
datagrid is bound too.

When I change the column to a combobox and set its datasource to the other
table and the datamember to the field in that other table, then run it, I get
the error above.

I know I am doing something wrong but not sure what it is. Any help would be
appreciated. I hope I have given enough info.

Dude the problem you are having is a true pain in the ....

I solved it temporarily by adding a error handler to my datagrid that
does nothing about the error as in the code below

Public Sub on_dataerror(ByVal sender As Object, ByVal evt As
Windows.Forms.DataGridViewDataErrorEventArgs) Handles
DGVsubjects.DataError

End Sub


If you have come across the solution please let me know

Mar 29 '07 #2

P: n/a
I had the same problem with a datagrid I wanted to be 'read only'.
When exiting the form I received a message telling me that I hab to handle
the DataError event to avoid my combobox wrong format (???).

Here is what I did :
- open the DataGrid properties
- click in the DataError event line
- type _DoNothingOnDataError

I have absolutely no idea why such error happens but here is my workaround

Hope this helps.... or if anyone knows how to display a ComboBox column in a
clean way please let us know.
"Chris" wrote:
I apparently have no idea what I am doing. ;o(

I have a datagridview bound to a dataset. I want to make one of the columns
a combobox that displays a list of choices I have in another table. When the
user clicks on that combobox, it should display those choices, allow them to
chose one, then when the save the data, it is saved into the table the
datagrid is bound too.

When I change the column to a combobox and set its datasource to the other
table and the datamember to the field in that other table, then run it, I get
the error above.

I know I am doing something wrong but not sure what it is. Any help would be
appreciated. I hope I have given enough info.
May 16 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.