Save / clear grid preferences¶
This operation captures the current grid layout (column order, widths, sort, and size) into the user's preference store, or removes all previously stored preference entries for a grid.
| Field | Value |
|---|---|
| Operation ID | OP-CORE-005 |
| Trigger | User action on a consuming page (save layout / reset layout) |
| Inputs | Grid instance, IncludeSort flag, optional height/width, SizeOnly flag |
| Outputs | Persisted or removed preference entries |
| Primary components | AppViewPageBase.SavePreferences, AppViewPageBase.ClearPreferences, AppViewPageBase.SaveDefaultLayout, AppViewPageBase.GetSortPrefs |
| Entry point | SAIF.Presentation.Web.Core.Infragistics111/AppViewPageBase.aspx.vb |
Steps¶
- Unless
SizeOnlyis set, iterate every band of the grid and build comma-delimited column-key and column-width lists. (BR-CORE-014) AddtheColNames…andColWidths…entries to the preference store for each band.- Evaluate the
IncludeSortflag. - If
True: build the sort preference string viaGetSortPrefsfrom the band'sSortedColumns.- If the built string is non-empty: add
ColSort…to the preference store. (BR-CORE-015) - If empty: skip adding the sort entry.
- If the built string is non-empty: add
- If
False: skip sort preference handling entirely. - Evaluate
HeightandWidth. - If both are greater than zero: add
GridSize<gridID>as"<height>px,<width>px". (BR-CORE-016) - Otherwise: skip persisting a grid size.
- Call
Preferences.Save()to persist all pending changes. -
Origin: Persistence is delegated to
m_controller.Model.Preferences(SAIF.Framework.Preferences, packageSAIF.BOF.Framework); the callee's storage mechanism is not visible from this repository.** ClearPreferencesremoves theColNames…,ColWidths…,ColSort…andGridSize…entries and callsPreferences.Save().- Note:
Save()is invoked twice in succession in both theUltraWebGridandWebDataGridoverloads (AppViewPageBase.aspx.vblines 426–427 and 707–708) — a redundant call with no functional effect beyond the extra round trip.*
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([User saves or clears layout]) --> Which{Save or Clear?}
Which -->|Save| S1{SizeOnly?}
S1 -->|No| S2[Build ColNames/ColWidths per band]
S1 -->|Yes| S3[Skip column capture]
S2 --> S4{IncludeSort?}
S3 --> S4
S4 -->|Yes, non-empty sort| S5[Add ColSort entry]
S4 -->|No / empty| S6[Skip sort entry]
S5 --> S7{Height and Width > 0?}
S6 --> S7
S7 -->|Yes| S8[Add GridSize entry]
S7 -->|No| S9[Skip grid size]
S8 --> S10[Preferences.Save]
S9 --> S10
Which -->|Clear| C1[Remove ColNames/ColWidths/ColSort/GridSize entries]
C1 --> C2[Preferences.Save called twice]
Failure and edge-case behavior¶
ClearPreferencescallingPreferences.Save()twice is a known redundancy, not a functional defect — the second call persists no additional changes.*- No validation occurs on the supplied
Height/Widthbeyond the zero-or-greater check.
Related documentation¶
Sources¶
SAIF.Presentation.Web.Core.Infragistics111/AppViewPageBase.aspx.vb