Found the following interesting discussion in the Newsgroups:
| Combobox in datagrid? by:John Doe | |
| 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? | |
| Reply: by:Cor Ligthert | |
| 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 | |
Posted by Xander Zelders

0 Comments:
Post a Comment
<< Home