469,133 Members | 1,458 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,133 developers. It's quick & easy.

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 1292
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Gamze | last post: by
3 posts views Thread by Bill C. | last post: by
2 posts views Thread by john sutor | last post: by
2 posts views Thread by pei_world | last post: by
3 posts views Thread by TT (Tom Tempelaere) | last post: by
reply views Thread by dbuchanan | last post: by
1 post views Thread by fiaolle | last post: by
4 posts views Thread by JJGarcia | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.