InfragisticsGridCustomizer¶
InfragisticsGridCustomizer is the actual state holder behind grid customization: a list of HidableInfragisticsColumn wrappers plus page-size/paging state for one UltraWebGrid. ModalGridCustomizer creates and caches one instance per grid on the model (via InfragisticsGridCustomizerList), and this class is where saved clsPreferences are read on construction, applied to the live grid (ManipulateGrid), updated from user choices (Update), and written back out (SavePreferences). (BR-AJAX-021)
Purpose¶
- Reads a saved page size from
clsPreferenceswhen paging is controlled, otherwise falls back to the grid's own pager setting, otherwise defaults to 50 rows. (BR-AJAX-022, BR-AJAX-023) - Validates that every always-visible/always-hidden override names a real grid column, and wraps each column as a
HidableInfragisticsColumnwith its initial visibility derived from the grid definition. (BR-AJAX-024, BR-AJAX-025) - Loads any saved column-selection preference, applying only to columns still present and in
Normalvisibility mode. (BR-AJAX-027, BR-AJAX-028) - Applies the resolved state to the live grid — inserting/removing columns and forcing paging settings — through
ManipulateGrid. (BR-AJAX-040, BR-AJAX-041) - Persists the current selection and page size into
clsPreferenceswhen the user explicitly saves. (BR-AJAX-039)
Context¶
- Namespace:
SAIF.Presentation.Web.Controls.V2.AJAX - Assembly/package:
SAIF.Presentation.Web.Controls.AJAX.Infragistics111(packaged inSAIF.BOF.Presentation.Web.Infragistics111) - Base class:
Generic.List(Of HidableInfragisticsColumn)(.NET Framework) - Consumes
clsPreferencesfromSAIF.Framework.Preferences(packageSAIF.BOF.Framework) andSAIF.Framework.StandardFormats.PadCapitalLettersFormatfromSAIF.Framework.
Public members¶
| Member | Signature | Purpose |
|---|---|---|
New |
Sub New(grid As UltraGridColumn(), alwaysVisible As String, alwaysHidden As String, controlPaging As Boolean, preferences As clsPreferences) |
Splits override lists, resolves the target grid, records ControlPaging, determines page size, validates and wraps columns, and loads saved preferences |
PageSize |
Property PageSize As Integer (default 50) |
Current page size applied to the grid when ControlPaging is set (BR-AJAX-023) |
ControlPaging |
ReadOnly Property ControlPaging As Boolean |
Whether this customizer controls the grid's paging |
TargetGridId |
ReadOnly Property TargetGridId As String |
ID of the UltraWebGrid this instance manages |
ListItems |
Function ListItems() As ListItem() |
Builds one ListItem per selectable column for the customization popup, skipping always-hidden columns (BR-AJAX-032, BR-AJAX-033, BR-AJAX-034) |
VisibleItems |
ReadOnly Property VisibleItems As Generic.List(Of HidableInfragisticsColumn) |
The subset of managed columns currently marked visible |
PreferenceData |
ReadOnly Property PreferenceData As String |
The ColumnPreferenceList string form of the current selection, as persisted to clsPreferences |
Update |
Sub Update(selections As Generic.IEnumerable(Of String), pageSize As Integer) |
Applies the user's checkbox selections and page-size choice to the managed column list, honoring AlwaysVisible/AlwaysHidden locks (BR-AJAX-028) |
ManipulateGrid |
Sub ManipulateGrid() |
Inserts/removes columns on the live grid to match managed visibility, and forces paging settings when ControlPaging is set (BR-AJAX-040, BR-AJAX-041) |
BindGrid |
Sub BindGrid() |
Raises the grid-rebind step used after customization |
BindObjectBinder |
Sub BindObjectBinder(binder As Object) |
Invokes the supplied clsObjectBindManager to rebind the grid from the model |
SavePreferences |
Sub SavePreferences(preferences As clsPreferences) |
Writes IGC_<gridId>_ColumnSelection and IGC_<gridId>_PageSize into clsPreferences and calls Preferences.Save() (BR-AJAX-039) |
DefaultPageSize |
Const DefaultPageSize As Integer = 50 |
Page size used when no saved preference or grid pager setting is available (BR-AJAX-023) |
MinimumPagesForDisplay |
Const MinimumPagesForDisplay As Integer = 2 |
Minimum page count before the grid's pager is shown (BR-AJAX-023) |
Nested types¶
| Type | Kind | Purpose |
|---|---|---|
VisiblityModes |
Enum (Normal, AlwaysVisible, AlwaysHidden) |
Per-column mode that governs whether the user or saved preferences can change a column's visibility (BR-AJAX-028) |
Behavioral notes¶
- A missing override column throws
ApplicationExceptionnaming the grid and the offending column, so misconfiguredAlwaysVisibleColumns/AlwaysHiddenColumnsfail fast at construction. (BR-AJAX-024) - A saved column-selection preference naming a column no longer present in the grid is ignored rather than causing an error, so renamed/removed columns do not break the page. (BR-AJAX-027)
- Hiding a column via
ManipulateGridremoves it from the grid'sColumnscollection entirely rather than merely styling it hidden, so hidden column data is never sent to the client. (BR-AJAX-040)
Constraints and usage notes¶
- Instances are intended to be created once per grid per model and cached in an
InfragisticsGridCustomizerList, not re-created on every postback. (BR-AJAX-021) - Columns whose
VisiblityModeis notNormalare never inserted or removed byManipulateGrid, regardless of the caller's requested visibility. (BR-AJAX-028)
Related documentation¶
Sources¶
SAIF.Presentation.Web.Controls.AJAX.Infragistics111/InfragisticsGridCustomizer.vb