Apply saved grid preferences¶
This operation restores a signed-in user's previously saved grid layout — column order, column widths, sort order, and overall grid size — for either an UltraWebGrid or a WebDataGrid, keyed per grid and per band.
| Field | Value |
|---|---|
| Operation ID | OP-CORE-004 |
| Trigger | Called by a consuming page while rendering a grid |
| Inputs | Grid instance, optional size div, the user's preference store (m_controller.Model.Preferences) |
| Outputs | Reordered/resized grid columns, applied sort criteria, applied grid height/width |
| Primary components | AppViewPageBase.ApplyColumnPreferences, AppViewPageBase.ApplySortPreferences, AppViewPageBase.ApplyColSettings, AppViewPageBase.ApplyDefaultLayout |
| Entry point | SAIF.Presentation.Web.Core.Infragistics111/AppViewPageBase.aspx.vb |
Steps¶
- Compute the band key for the grid band (
GetBandKey) so multi-bandUltraWebGridlayouts store preferences separately from single-band grids. (BR-CORE-011) - Read
ColNames<gridID><bandKey>,ColWidths<gridID><bandKey>andGridSize<gridID>from the preference store. - If an entry is missing: treat it as "no preference" for that dimension and skip applying it.
-
Origin: Preference retrieval delegates to
m_controller.Model.Preferences(SAIF.Framework.Preferences, packageSAIF.BOF.Framework). The callee's own storage/lookup steps are not visible from this repository.** - Apply the stored column order and widths to the grid band, then apply the stored grid height/width to the grid (and to the containing size
divwhen supplied). (BR-CORE-012) - Read
ColSort<gridID><bandKey>and re-apply the stored sort direction per column. (BR-CORE-013) GetSortPreferenceOrderByconverts the stored sort preference into anORDER BYfragment.- The caller is responsible for appending this fragment to its own data retrieval query. This library builds the fragment only; it issues no SQL of its own.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Grid rendering begins]) --> S1[Compute band key]
S1 --> S2[Read ColNames/ColWidths/GridSize from Preferences]
S2 --> Found{Preference entry present?}
Found -->|No| Skip([Skip that dimension])
Found -->|Yes| S3[Apply column order, widths, grid size]
S3 --> S4[Read ColSort and re-apply sort]
S4 --> S5[GetSortPreferenceOrderBy builds ORDER BY fragment]
S5 --> EndOk([Caller appends fragment to its own query])
Failure and edge-case behavior¶
- Missing preference entries never raise — the corresponding layout dimension simply reverts to the grid's design-time default.
- No SQL is executed by this operation;
GetSortPreferenceOrderByreturns a fragment string that the caller must incorporate safely into its own parameterized query.*
Related documentation¶
Sources¶
SAIF.Presentation.Web.Core.Infragistics111/AppViewPageBase.aspx.vb