Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
17645 | Aug 13,2004 08:32 AM UTC | Aug 13,2004 05:34 PM UTC | WinForms | 9 |
![]() |
Tags: GridControl |
GridStyleInfo style = this.grid.InternalCOlumns["Employees"].StyleInfo;
style.CellType = "COmboBox";
style.DataSource = dataset.tables["emp"];
style.DisplayMember = "SomePropertyInTheEmpTable";
style.ValueMember = "PropetyInTheEmpTableThatMatchesTheValuesInTheDeptTable";
There are samples of such comboboxes in Grid\Samples\DataBound\GDBGcombos.
If you are not trying to do a foreign key combobox column, but instead want an hierarchical grid showing a data relation between your dept and your emp table, then you should look at the Grid\Samples\DataBound\Hierarchical\ExpandGrid sample.
Normally, you do not need to handle events for either of these tasks (unless you want to customize the default behaviors.)
>GridStyleInfo style = this.grid.InternalCOlumns["Employees"].StyleInfo;
>style.CellType = "COmboBox";
>style.DataSource = dataset.tables["emp"];
>style.DisplayMember = "SomePropertyInTheEmpTable";
>style.ValueMember = "PropetyInTheEmpTableThatMatchesTheValuesInTheDeptTable";
>
>
>There are samples of such comboboxes in Grid\Samples\DataBound\GDBGcombos.
>
>If you are not trying to do a foreign key combobox column, but instead want an hierarchical grid showing a data relation between your dept and your emp table, then you should look at the Grid\Samples\DataBound\Hierarchical\ExpandGrid sample.
>
>Normally, you do not need to handle events for either of these tasks (unless you want to customize the default behaviors.)
DataColumn dcSHPShipmentNo = dstOutSchDetails.Tables[0].Columns["strShipmentNo"];
DataColumn dcOrderShipmentNo = dstOutSchDetails.Tables[1].Columns["strShipmentNo"];
dstOutSchDetails.Tables[0].ChildRelations.Add(dcSHPShipmentNo, dcOrderShipmentNo);
There is no need for any kibnd of relation here unless you are trying to use a Hierarchial grid, in which case, there woul dbe no combobox involved. If you want an hiearchical grid, look at teh ExpandGrid sample and set thisng up that way. (No ChildRelations, add teh releation directly to teh dataset.Relations collection as in that sample.)
If you are trying to use a combobox and not an hierarchical grid (showing related tables), other things to check are that strShipmentNo should be the exact (case counts) column names for columns in both table0 and table1. Also, strOrderNo must be a column in table1.
>DataColumn dcSHPShipmentNo = dstOutSchDetails.Tables[0].Columns["strShipmentNo"];
>DataColumn dcOrderShipmentNo = dstOutSchDetails.Tables[1].Columns["strShipmentNo"];
>dstOutSchDetails.Tables[0].ChildRelations.Add(dcSHPShipmentNo, dcOrderShipmentNo);
>
>
>There is no need for any kibnd of relation here unless you are trying to use a Hierarchial grid, in which case, there woul dbe no combobox involved. If you want an hiearchical grid, look at teh ExpandGrid sample and set thisng up that way. (No ChildRelations, add teh releation directly to teh dataset.Relations collection as in that sample.)
>
>If you are trying to use a combobox and not an hierarchical grid (showing related tables), other things to check are that strShipmentNo should be the exact (case counts) column names for columns in both table0 and table1. Also, strOrderNo must be a column in table1. This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.