Cascade grid drop-down value lists¶
This operation binds two UltraWebGrid columns' value lists from consumer-supplied data sources, projects both sources into flattened lookup items, and registers the client script that filters the child column's options based on the parent column's selected value.
| Field | Value |
|---|---|
| Operation ID | OP-01 |
| Trigger | Consuming page calls DataBind() on the control (directly or via page-level DataBind) |
| Inputs | Column1, Column2, List1, List2, List1Code, List1Display, List2Code, List2Display, List2Key |
| Outputs | Bound ValueList on both grid columns; populated l1/l2; a registered client script block named DD |
| Primary components | clsDropDownController.DataBind |
| Entry point | SAIF.Presentation.Web.Controls.Infragistics111/clsDropDownController.vb |
Steps¶
- Call
MyBase.DataBind()to run the standardControldata-binding pass. - On failure: errors propagate from the base implementation.
- Assign
List1toColumn1.ValueList.DataSourceand setDisplayMember/ValueMemberfromList1Display/List1Code, then callColumn1.ValueList.DataBind()(BR-CTL-004). - On failure: an unset
Column1raises aNullReferenceException— no guard exists. - Repeat step 2 for
Column2usingList2,List2Display,List2Code(BR-CTL-004). - On failure: same failure mode as step 2, for
Column2. - Set
Column1.Band.Grid.DisplayLayout.ClientSideEvents.BeforeEnterEditModeHandlerto"BeforeEdit" & Column2.Key, wiring the generated function into the grid (BR-CTL-003). - Project every item in
List1into aListItemby reflecting overTypeDescriptor.GetProperties, copying the property matchingList1Codeintoidand the property matchingList1Displayintodesc, but only when the property type has aTypeConverterthat can convert toSystem.String(BR-CTL-005). Add each projected item tol1. - If a property's converter cannot target
String: the property is skipped, leavingid/descNothingfor that entry. - Project every item in
List2the same way, additionally copying the property matchingList2Keyintokey(BR-CTL-005, BR-CTL-002). Add each projected item tol2. - Call Generate the cascade script and discard the result, then call it a second time and register the returned script with
Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "DD", …). - The first call is redundant work — the script is built twice per data-bind, with no observable side effect from the discarded call.*
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([DataBind called]) --> S1["MyBase.DataBind()"]
S1 --> S2["Bind Column1.ValueList<br>from List1"]
S2 --> S3["Bind Column2.ValueList<br>from List2"]
S3 --> S4["Wire BeforeEnterEditModeHandler<br>to BeforeEdit + Column2.Key"]
S4 --> S5["Project List1 items into l1"]
S5 --> S6["Project List2 items into l2"]
S6 --> S7["Generate + register<br>cascade script (DD)"]
S7 --> EndOk([DataBind complete])
Failure and edge-case behavior¶
- An unset
Column1orColumn2raises an unhandledNullReferenceException— there is no null guard before theValueListassignments. - A source item whose
List1Code/List1Display/List2Code/List2Display/List2Keyproperty is not string-convertible is silently skipped rather than causing a bind failure (BR-CTL-005).
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
SAIF.Presentation.Web.Controls.Infragistics111/clsDropDownController.vb