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

Combobox in datagrid?

Now i know how to manually add a combobox to a datagrid,
but how would i handle the recordset below?

ID | FirstName | LastName | Job
--------------------------------
1 |Joe | Smith | janitor
1 |Joe | Smith | cashier
2 |Bob | Anderson | cook

I want to bind the above datatable to a datagrid so that
Job field will be a combobox of the appropriate list of
jobs. So for Joe Smith, it will have janitor and cashier,
for Bob, it will only have cook. So the datagrid would
only display the two row (one for each person). Is there
a way to do this without having to look through the rows
and manually adding to the combobox? Some kind of group by
functionality?
Nov 20 '05 #1
1 1449
Hi John,

I assume you mean a dataset and not a recordset.
There is no standard combobox for the datagrid, they all are inheritted
ones, so the answer is difficult to give with code.

However the answer is most probably Yes most comboboxes for datagrid work
the same as a normal combobox so you can add in your code the items you
want.

And when you want it from a datatable than you have to make that datatable.
When you want the selectedvalue, than you need a columntype
datagridcombobox.

I hope this helps,

Cor
..

"John Doe" <an*******@discussions.microsoft.com> schreef in bericht
news:28*****************************@phx.gbl...
Now i know how to manually add a combobox to a datagrid,
but how would i handle the recordset below?

ID | FirstName | LastName | Job
--------------------------------
1 |Joe | Smith | janitor
1 |Joe | Smith | cashier
2 |Bob | Anderson | cook

I want to bind the above datatable to a datagrid so that
Job field will be a combobox of the appropriate list of
jobs. So for Joe Smith, it will have janitor and cashier,
for Bob, it will only have cook. So the datagrid would
only display the two row (one for each person). Is there
a way to do this without having to look through the rows
and manually adding to the combobox? Some kind of group by
functionality?

Nov 20 '05 #2

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

Similar topics

0
by: Gamze | last post by:
Hi, In my vb.net windows application ,i have combobox which is populated by sqlserver database table.When i select value from combobox ,value saved in to other table of my database and i use to...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
2
by: john sutor | last post by:
Does anyone know how to create a combobox in a standard datagrid? I can create check boxes , but not the combobox
3
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
0
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
1
by: fiaolle | last post by:
Hi The first set of source code is the class for a combobox in a grid, hopefully. In the second set of code we try to use the combobox class, but the grid is empty. I don't understand how this...
4
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection,...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.