473,385 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

linking Form's ComboBox to DataGridViewComboBox

Hi, i have one question and one opinion i seek. please assist if you can.
I am using VS2005 beta.

1) I have two tables with the following columns
Security: security_id, name, symbol, exchange_id
Exchange: exchange_id, symbol, name
2) I have a Form that contains a combobox (cb1) and DataViewGrid (dg1).
3) The source for the DataViewGrid is the Security table and the source of
the combo box is the Exchange table
4) Before assigning the DataTable representing the Security table to
dg1.datasource, i remove the exchange_id column, and replace with
DataGridViewComboBoxColumn.
5) the properties for the DataGridViewComboBoxColumn are: DataPropertyName =
exchange_id, ValueMember = exchange_id, DisplayMember = "symbol", HeaderText
= "exchange". the DataSource is the ExchangeTable.
6) the source the Combox on the form is the same setup as that for the
DataGridViewComboBoxColumn
7) all this works fine...

QUESTION:
8) NOW, when i select a value in cb1, i would like the "exchange" column
(which is also a combobox) of ALL ROWS in the grid to reflect the value i
select (i.e. i want them all to change to what i select).
Currently i do this by using a foreach loop on the DataRows collection. i am
wondering if there is a more efficient way of doing this.
9) also, for some reason, although i believe i setup the
DataGridViewComboBoxColumn correctly, it does not show the "symbol" (even
though i have that set as the DisplayMember), it still shows the
"exchange_id". i believe this is because i am eating and error thrown by the
datagrid that states: "The value of the DataGridViewComboBoxCell is
invalid.".
I don't know why it is giving me this error. based on how i configured this
combobox, can anyone tell me why this is happening.

thank you much
Nov 16 '05 #1
2 4007
ping...

"dimension" wrote:
Hi, i have one question and one opinion i seek. please assist if you can.
I am using VS2005 beta.

1) I have two tables with the following columns
Security: security_id, name, symbol, exchange_id
Exchange: exchange_id, symbol, name
2) I have a Form that contains a combobox (cb1) and DataViewGrid (dg1).
3) The source for the DataViewGrid is the Security table and the source of
the combo box is the Exchange table
4) Before assigning the DataTable representing the Security table to
dg1.datasource, i remove the exchange_id column, and replace with
DataGridViewComboBoxColumn.
5) the properties for the DataGridViewComboBoxColumn are: DataPropertyName =
exchange_id, ValueMember = exchange_id, DisplayMember = "symbol", HeaderText
= "exchange". the DataSource is the ExchangeTable.
6) the source the Combox on the form is the same setup as that for the
DataGridViewComboBoxColumn
7) all this works fine...

QUESTION:
8) NOW, when i select a value in cb1, i would like the "exchange" column
(which is also a combobox) of ALL ROWS in the grid to reflect the value i
select (i.e. i want them all to change to what i select).
Currently i do this by using a foreach loop on the DataRows collection. i am
wondering if there is a more efficient way of doing this.
9) also, for some reason, although i believe i setup the
DataGridViewComboBoxColumn correctly, it does not show the "symbol" (even
though i have that set as the DisplayMember), it still shows the
"exchange_id". i believe this is because i am eating and error thrown by the
datagrid that states: "The value of the DataGridViewComboBoxCell is
invalid.".
I don't know why it is giving me this error. based on how i configured this
combobox, can anyone tell me why this is happening.

thank you much

Nov 16 '05 #2
Hello "dimension"

also I have found a similar problem, sent in this newsgroup today. If you
had to find a solution to the problem, I ask you to communicate it for
information to me.

Good job.

Dumbo

"dimension" wrote:
Hi, i have one question and one opinion i seek. please assist if you can.
I am using VS2005 beta.

1) I have two tables with the following columns
Security: security_id, name, symbol, exchange_id
Exchange: exchange_id, symbol, name
2) I have a Form that contains a combobox (cb1) and DataViewGrid (dg1).
3) The source for the DataViewGrid is the Security table and the source of
the combo box is the Exchange table
4) Before assigning the DataTable representing the Security table to
dg1.datasource, i remove the exchange_id column, and replace with
DataGridViewComboBoxColumn.
5) the properties for the DataGridViewComboBoxColumn are: DataPropertyName =
exchange_id, ValueMember = exchange_id, DisplayMember = "symbol", HeaderText
= "exchange". the DataSource is the ExchangeTable.
6) the source the Combox on the form is the same setup as that for the
DataGridViewComboBoxColumn
7) all this works fine...

QUESTION:
8) NOW, when i select a value in cb1, i would like the "exchange" column
(which is also a combobox) of ALL ROWS in the grid to reflect the value i
select (i.e. i want them all to change to what i select).
Currently i do this by using a foreach loop on the DataRows collection. i am
wondering if there is a more efficient way of doing this.
9) also, for some reason, although i believe i setup the
DataGridViewComboBoxColumn correctly, it does not show the "symbol" (even
though i have that set as the DisplayMember), it still shows the
"exchange_id". i believe this is because i am eating and error thrown by the
datagrid that states: "The value of the DataGridViewComboBoxCell is
invalid.".
I don't know why it is giving me this error. based on how i configured this
combobox, can anyone tell me why this is happening.

thank you much

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tony Williams | last post by:
I have two tables one lists the names of committees and the other is a list of documents they generate. I have a form based on the documents table which gives details of the document including...
1
by: New2Access | last post by:
I posted this yesterday but perhaps I wasn't clear enough. I have a table called History with 4 fields "Week" "Employee" "Project" and "Hours" Each of those fields (except Hours) are based on...
0
by: Rob Kennedy | last post by:
I am using a form with 2 linked combo boxes to query results on a sub-form. With my extreme lack of Access programming skills and the wealth of information on this forum I have been able to...
3
by: John | last post by:
Hi, I`m relitavely new to Access and have designed a small simple database for collecting information about club members (supporters club) and their subscriptions/payments.I have it all done...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
1
by: Danny M | last post by:
Does anyone ave a good exsample on how you bind 2 tables into a datagridview where the second table is the values of a dropdownbox. With delete (whole row not dropdownbox table) and edit ?
1
by: tim8w via DotNetMonster.com | last post by:
I am using a DataGridViewComboBox in a DataGridView. When a user selects a radio button, I would like to clear all the items in the DataGridViewComboBox and repopulate with new values. I do this as...
0
by: RN | last post by:
All, I have a datagridview control displaying two columns(part number and revision). Both columns are read only. the revision colum is a datagridviewcombobox colum. I would like for the items...
1
by: Ang | last post by:
HI, I want to put several DataGridViewComboBox (which map their own datatable) into a DataGridView. Different Rows of DataGridView will load their own DataGridViewComboBox. is it possible to do...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.