There is a ultraGrid and ultraDropDown on the winform, the ultragrid has ITNO,FGName,Unit,Remark four columns,and ultraDropDown has ITNO,FGName,Unit columns, the ultraDropDown is binded with ultraGrid by ITNO, Now I want to do as below: When user click the ITNo column of ultraGrid ,it shows the ultradropdown, when user select one row of ultradropdown the column's value of ITNo、FGName、Unit in ultraGrid is from the column's value of ITNo、FGName、Unit in ultraDropDown.
Thanks
who can help me above problem?
thanks
There are a number of ways you could do this. I would probably trap the CellListCloseUp event on the grid. You can trap for the ItemNo column and then the list is closed for that column, you can seach the list to find the selected item no and then get the other values from that row in the UltraDropDown and copy them into the grid's ActiveRow.
However.. isn't it a bit redundant to be storing all of the data in two places? It seems to me that if the other fields you are displaying in the grid are all dependent on the ItemNo, then the table you are binding to the grid does not need to have all of those fields. What I would do is just bind the grid to a data source that has only the ItemNo. Then I would add unbound column's to the grid to show the other data and populate the unbound cells using the grid's InitializeRow event. Then you could not need to do anything when the user selects a new ItemNo, since the InitializeRow would fire automatically and populate the row.