473,231 Members | 1,722 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,231 software developers and data experts.

Datagrid: Linking combobox columns?

I'm trying to use a datagrid for data entry. I've created a couple of combo
box columns using information from
http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q480q

That example basically sets every combobox in a given column (for every row)
to the same datasource.

One obstacle I have to overcome is when a user changes a value in one
column, the next combobox in the next column on the same row needs to bind to
a new set of data, and only for that row. For example, Column A is Cost
Centers, Column B is Job Codes. If I select a Cost Center from Column A, the
combo in Column B needs to list only valid Job Codes for the previously
selected Cost Center, on a row-by-row basis.

Any idea how to do this, or is there a sample somewhere someone could point
me to?

Thanks!

Jul 21 '05 #1
3 1692
JV
You just need to set up the combo box to allow postback so that you can hook
into the SelectionChanged event.
Similar to this:
http://msdn.microsoft.com/library/de...ebcontrols.asp

You may want to also consider the thoughts in this article:
http://msdn.microsoft.com/library/de...ebcontrols.asp

"JAdrianB" <JA******@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...
I'm trying to use a datagrid for data entry. I've created a couple of
combo
box columns using information from
http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q480q

That example basically sets every combobox in a given column (for every
row)
to the same datasource.

One obstacle I have to overcome is when a user changes a value in one
column, the next combobox in the next column on the same row needs to bind
to
a new set of data, and only for that row. For example, Column A is Cost
Centers, Column B is Job Codes. If I select a Cost Center from Column A,
the
combo in Column B needs to list only valid Job Codes for the previously
selected Cost Center, on a row-by-row basis.

Any idea how to do this, or is there a sample somewhere someone could
point
me to?

Thanks!

Jul 21 '05 #2
Woops, sorry, I'm in the WinForms datagrid. ASP.Net handles this type of
thing pretty well, but I have to figure out how to pull it off on WinForms.
Thanks, though.

"JV" wrote:
You just need to set up the combo box to allow postback so that you can hook
into the SelectionChanged event.
Similar to this:
http://msdn.microsoft.com/library/de...ebcontrols.asp

You may want to also consider the thoughts in this article:
http://msdn.microsoft.com/library/de...ebcontrols.asp

"JAdrianB" <JA******@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...
I'm trying to use a datagrid for data entry. I've created a couple of
combo
box columns using information from
http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q480q

That example basically sets every combobox in a given column (for every
row)
to the same datasource.

One obstacle I have to overcome is when a user changes a value in one
column, the next combobox in the next column on the same row needs to bind
to
a new set of data, and only for that row. For example, Column A is Cost
Centers, Column B is Job Codes. If I select a Cost Center from Column A,
the
combo in Column B needs to list only valid Job Codes for the previously
selected Cost Center, on a row-by-row basis.

Any idea how to do this, or is there a sample somewhere someone could
point
me to?

Thanks!


Jul 21 '05 #3

In the Column A Combobox.SelectionChangeCommitted Event
You can reset Column B's combobox's datasource, or filter the job codes
for the selected Cost Center, assuming ComboBox B is bound to a
datatable or dataview.

David
"JAdrianB" <JA******@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...
I'm trying to use a datagrid for data entry. I've created a couple of combo box columns using information from
http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q480q

That example basically sets every combobox in a given column (for every row) to the same datasource.

One obstacle I have to overcome is when a user changes a value in one
column, the next combobox in the next column on the same row needs to bind to a new set of data, and only for that row. For example, Column A is Cost
Centers, Column B is Job Codes. If I select a Cost Center from Column A, the combo in Column B needs to list only valid Job Codes for the previously
selected Cost Center, on a row-by-row basis.

Any idea how to do this, or is there a sample somewhere someone could point me to?

Thanks!

Jul 21 '05 #4

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

Similar topics

7
by: Billy Jacobs | last post by:
I am using a datagrid to display some data. I need to create 2 header rows for this grid with columns of varying spans. In html it would be the following. <Table> <tr> <td colspan=8>Official...
1
by: Tom Rahav | last post by:
Hi! My question is if it's possible to adjust DataGrid control's columns' width by code (runtime). I have a DataGrid control that displays table from dataset that contains two fields. The first...
3
by: bafidi | last post by:
My problem is databind datagrid to combobox. i want to click to datagrid and i want to see that record at combobox and texboxes after that i want to change combobox and texboxes and i want to...
1
by: Jimmy | last post by:
Hi I want to display my datagrid with the columns horizontal and rows vertical, so just the other way around. For example instead of : name address city Tom ...
0
by: Trint Smith | last post by:
the less the data going to my datagrid, the wider the lines and columns...how can i keep the datagrid rows and columns the same size no matter how much data is being displayed? thanks, Trint ...
3
by: JAdrianB | last post by:
I'm trying to use a datagrid for data entry. I've created a couple of combo box columns using information from http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q480q That example basically sets...
0
by: zhuang | last post by:
Hi, Adding combobox to datagrid has been posted many times. I have a datagrid which has multiple combobox columns and normal textbox columns. But how could I change other combo box values at...
1
by: fiaolle | last post by:
Hi I have a DataGrid with ComboBox columns. I want the same thing to happen as when a user clicks and chooses an item in the ComboBox. When a user stands in the last row (new row) and clicks for...
1
by: alexmax2003 | last post by:
That quotation was add b4 i need to know from VB.Net wizards The answer "I'm trying to use a datagrid for data entry. I've created a couple of combo box columns using information from...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.