473,503 Members | 5,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datagridviewcomboboxcell value is not valid

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
2 18645
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3013
by: Moshazu | last post by:
I am attempting to use the DataGridView control in my software and have not been able to easily find answers to a couple of questions that I have. 1. Is the only way to change the data in a...
0
3046
by: Jay | last post by:
I am using Windows .Net 2.0 SDK I have a DataGridView control in a windows form. None of my controls are databound prior to run time. I am creating a string array with which I want to populate...
1
23618
by: hangdee | last post by:
I have a DatagridviewComboBoxCell with self added object (with an id and a string field) as items to the DatagridviewComboBoxCell. Dim cboCell As New DataGridViewComboBoxCell...
1
6431
by: aXqd | last post by:
i want a editable comboboxcell for a datagridview, i have done these: public partial class Form1 : Form { .... private static List<string_tempList = new List<string>(new string {}); ....
0
3371
by: news.microsoft.com | last post by:
Hello- I'm having a dickens of a time trying to set the value on a DataGridViewComboBoxColumn. I actually have two DataGridViewComboBoxColumns in my datagrid view. First, I'm setting up the...
42
3508
by: polas | last post by:
Afternoon all, I have some code (which I thought was OK, but now appreciate is probably not by the standard) which contains int a; ...... if (a==NULL) { ....
4
2701
by: Martin Horst | last post by:
Hi, I've got a Windows Form DataGridView with several DataGridViewComboBoxCell columns. The Items collection of the DataGridViewComboBoxCell can take any kind of objects. But when the user...
0
4223
by: ANILMOURYA | last post by:
private void FlexGrdRsltConv_CellEnter(object sender, DataGridViewCellEventArgs e) { if (blnRowenter) { return;} if...
4
10307
by: Jaydeep Ramavat | last post by:
I am facing a problem in binding the datagridviewcombo box cell. DataGridViewComboBoxCell cmbControlTypes= new DataGridViewComboBoxCell(); cmbControlTypes.DataSource = result.resultTable;...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.