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
725
UltraWinGrid with dependent combos
posted

I'm working with UltraWinGrid (Infragistics2.Win.UltraWinGrid.v11.1 11.1.20111.2111) with 2 UltraCombo columns. A dropdownlist in a grid cell whose list values are dependent on another cell.(Combo1, Combo2).
Load all values in Combo2 and data will filter according to Combo1 in BeforeCellActivate event.... (http://blogs.infragistics.com/winforms/codesamples/creating-a-dropdown-list-in-a-grid-cell-whose-list-values-are-dependent-on-another-cell.aspx)
It's ok for introducing new rows because combo values are filtered.
But, to open the form and load grid with data values, the Combo2 description is wrong.

Example:
STATES: (Combo1)
IdState - Name
================
1         - State1
2         - State2

Combo1.ValueMember = IdState
Combo1.DisplayMember = Name

CITIES: PK(IdState,IdCity) (Combo2)
IdState - IdCity - Name
========================
1         - 1          - City1
2         - 1          - City2

Combo2.ValueMember = IdCity
Combo2.DisplayMember = Name

CUSTOMER (table):
IdCustomer - Name          - IdState(Combo1) - IdCity(Combo2) -.....
===================================================
1                - Customer1  - 2                          - 1

CUSTOMER (columns of the grid):
IdCustomer - Name         - State (Combo1)  - City (Combo2)
========================================================
1                - Customer1   - State2                - City1 --> (ERROR! Is City2!!)


When loading the grid and display customer data, such as Combo2 is full load, shows the description 'City1' (ERROR! Is City2!!)(the combo2 it's not filtering).

How can I solve the problem????
Must be filtered the combo in every row to the grid to display correct data values????
How can I work with dependent combos??

Thanks in advance.

Parents
No Data
Reply Children