Hi James,
You are right: Filtering of dropdown when multiple rows visible is NOT straightforward.
For argument's sake I will name like this:
Main-DW: DW displayed on screen having a DDDW column.
Child-DW: DW displayed as dropdown for the DDDW column.
Child-DW's primary buffer acts as a lookup table: Data displays with display value when data available in primary buffer.
Now, filtering moves all rows failing the filter-expression into the filter buffer. So such data-display rows are unavailable for the Main-DW.
There are several ways to circumvent this issue and still display the "display" value instead of "data" value for all non-current rows in Main-DW.
- No filtering of Child-DW, instead have rows display or hide in dropdown using other techniques.
Techniques:
- Each of my techniques in this case use extra column in Child-DW:
Column Name=IsActive, Type=long, Initial=1.
Custom filtering function: Rows passing filter => IsActive=1, Rows failing filter => IsActive=0
- OPTION A: Hide rows based on IsActive.
Detail band has AutoSizeHeight=true and Height=0.
Visible attribute on all objects in the detail band: if(IsActive=1, 1, 0)
- OPTION B: "Disable" rows based on IsActive.
Set Font.Strikethrough expression = if(IsActive=1, 0, 1) <= Normal or stricken out
Set Font.Color expression = if(IsActive=1, 0, 8421504 ) <= Black or grey(128, 128, 128)
- For both options: ItemChanged must fail any selection where IsActive = 0.
- Filter but use other technique to display "display" values for all non-current rows despite no row in Child-DW's primary buffer.
Techniques:
- OPTION C: Two DDDW columns display on top of each other.
Column having filtered DDDW > Visible = if( GetRow( ) = CurrentRow( ), 1, 0 )
Column having unfiltered DDDW > Visible = if( GetRow( ) = CurrentRow( ), 0, 1 )
This has resource consumption impact because you allocate an extra DDDW displaying all rows
Little performance impact though because you could do RowsCopy from one DDDW to the other instead of retrieving same data into both DDDW.
- OPTION D: Filter on/off like your link describes in detail.
This has performance impact because filter is being turned on and off every so often
I have used option B successfully because it works similar to having set of options where some are enabled, others are disabled, but all options appear in place just displaying differently. No surprise to the user like "why is my presumed 'option' gone?" Instead: "Ah! Disabled, so right now I can't choose this specific value.
HTH /Michael