datagridviewcomboboxcell value is not valid

G

Guest

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.
 
B

blackvine

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top