Skip to content

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

  1. Compute the band key for the grid band (GetBandKey) so multi-band UltraWebGrid layouts store preferences separately from single-band grids. (BR-CORE-011)
  2. Read ColNames<gridID><bandKey>, ColWidths<gridID><bandKey> and GridSize<gridID> from the preference store.
  3. If an entry is missing: treat it as "no preference" for that dimension and skip applying it.
  4. Origin: Preference retrieval delegates to m_controller.Model.Preferences (SAIF.Framework.Preferences, package SAIF.BOF.Framework). The callee's own storage/lookup steps are not visible from this repository.**

  5. 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 div when supplied). (BR-CORE-012)
  6. Read ColSort<gridID><bandKey> and re-apply the stored sort direction per column. (BR-CORE-013)
  7. GetSortPreferenceOrderBy converts the stored sort preference into an ORDER BY fragment.
  8. 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; GetSortPreferenceOrderBy returns a fragment string that the caller must incorporate safely into its own parameterized query.*

Sources

  • SAIF.Presentation.Web.Core.Infragistics111/AppViewPageBase.aspx.vb