Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3455
BindableValueList and BindingSource
posted
Hi,
I have two BindableValueList in WinGrid, one is master and the other is child. So the child must change the items according to the master. Can anyone help how to do this?
Regards,
Pgr2007
Parents
  • 469350
    Offline posted

    There's no automatic way to do this. You can't have the child ValueList automatically update based on the position of the parent ValueList, because remember that the ValueList services multiple cells in the grid and therefore doesn't have a fixed position - it's position depends on the row int he grid. 

    There are two basic approaches you can take. 

    1) Set the ValueList in the Cell (not the column) to a new ValueList that contains the appropriate child informationbased on the value of the parent cell ineach row of the grid. You would likely do this in the InitializeRow event of the grid.

    2) Use an UltraDropDown instead of a ValueList and Filter the UltraDropDown based on the value in the parent cell. You would probably do this in AfterCellUpdate (after the parent cell is updated) or maybe in BeforeCellActivate (before the child cell is activated).

    This second approach has a slight advantage because if you are using the dropdown to translate data values into display text, the dropdown still contains all of the values. In the first approach, you might set the ValueList of the cell and the current Value of that child cell might not exist on the list which would mean the cell would show the data value - or perhaps the wrong text. 

Reply Children