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. 2 18657
On Jan 30, 8:43 pm, Chris <C...@discussio ns.microsoft.co mwrote:
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(By Val sender As Object, ByVal evt As
Windows.Forms.D ataGridViewData ErrorEventArgs) Handles
DGVsubjects.Dat aError
End Sub
If you have come across the solution please let me know
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 _DoNothingOnDat aError
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 DataGridViewComboBox during
the runtime the way that I have done it here? If not, is there an
easier way?
Dim tmpCMBRow As New DataGridViewRow
tmpCMBRow.CreateCells(Me.grid)
|
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 each DataGridViewComboBoxCell programmatically.
Some of the items in the comboboxcell controls may be the same, but most
will not, so I can not populate the DataGridViewComboBoxColumn.
I have tried adding rows to the datagrid using Rows.Add. I have...
|
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
cboCell.Items.Add(new MyObj(1,"Item 1"))
cboCell.Items.Add(new MyObj(2,"Item 2"))
cboCell.Items.Add(new MyObj(3,"Item 3"))
But I cannot find a method from DataGridViewComboBoxCell
to get back the selected MyObj in the cboCell list.
|
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
{});
....
|
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 grid/column as follows..
DataGridViewComboBoxColumn someColumn = new
DataGridViewComboBoxColumn();
| |
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)
{
....
|
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
selects another item inside the combobox, the Value property always
returns a string. In my case, I need the real object which was added to
the items collections. Is there any way to prevent this conversion.
Thanks in advance
|
by: ANILMOURYA |
last post by:
private void FlexGrdRsltConv_CellEnter(object sender, DataGridViewCellEventArgs e)
{
if (blnRowenter) { return;}
if (FlexGrdRsltConv.Columns.Name == "TxtEltCode")
{
DataGridViewComboBoxCell RowComboColumn = new DataGridViewComboBoxCell();
|
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;
cmbControlTypes.DisplayMember = "name";
cmbControlTypes.ValueMember = "id";
after binding the comboboxcell and adding it to row.
when i access the item collection as follows.
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |