---
title: Initialize a grid customizer
summary: Builds or retrieves the per-grid column/page-size customization state on first page load.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.AJAX.Infragistics111
reference_type: package
operation_id: OP-AJAX-08
trigger: First (non-postback) page load of a page hosting a ModalGridCustomizer
---

# Initialize a grid customizer

This operation resolves or creates the `InfragisticsGridCustomizer` for a target `UltraWebGrid`, restores any saved page-size and column-selection preferences, and applies the resulting state to the grid.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-AJAX-08 |
| **Trigger** | First (non-postback) page load |
| **Inputs** | Model's `GridCustomizers` list, `TargetControls.GridId`, `AlwaysVisibleColumns` / `AlwaysHiddenColumns`, saved `IGC_<gridId>_*` preferences |
| **Outputs** | An `InfragisticsGridCustomizer` instance with its column list initialized and applied to the grid |
| **Primary components** | `ModalGridCustomizer.ModalGridCustomizer_Load`, `GridCustomizer` property, `InfragisticsGridCustomizer.New` |
| **Entry point** | `SAIF.Presentation.Web.Controls.AJAX.Infragistics111/ModalGridCustomizer.vb` |

## Steps

1. On a non-postback load, read the `GridCustomizer` property.
2. That property resolves the model's `GridCustomizers` list by reflection and looks up an entry keyed by `TargetControls.GridId`; if absent it constructs a new `InfragisticsGridCustomizer` and adds it. ([BR-AJAX-021](../business-rules.md#br-ajax-021-grid-customization-state-is-created-once-per-grid-per-model-and-reused))
   - On failure: a missing target grid or missing object binder throws `ApplicationException` from the respective reflection property.
3. The constructor splits the designer-supplied `AlwaysVisibleColumns` / `AlwaysHiddenColumns` semicolon lists, resolves the target grid, and records `ControlPaging`.
4. Page size is taken from the saved `IGC_<gridId>_PageSize` preference when paging is controlled and a value exists; otherwise from the grid's own pager when `AllowPaging` is set; otherwise the default of 50. ([BR-AJAX-022](../business-rules.md#br-ajax-022-a-saved-page-size-overrides-the-designed-page-size-when-the-customizer-controls-paging), [BR-AJAX-023](../business-rules.md#br-ajax-023-page-size-defaults-to-50-rows-paging-shown-only-at-two-or-more-pages))
5. `InitializeColumnList` first validates that every override key names a real grid column, throwing `ApplicationException("Grid <id> does not contain column visibility override column <key>")` otherwise. ([BR-AJAX-024](../business-rules.md#br-ajax-024-every-override-column-must-exist-on-the-target-grid))
6. Each `UltraGridColumn` is wrapped in a `HidableInfragisticsColumn` whose initial visibility is `Not (Hidden Or ServerOnly)` and whose mode comes from the override lists. Always-hidden columns are forced to `ServerOnly`; all others have `Hidden` and `ServerOnly` cleared. ([BR-AJAX-025](../business-rules.md#br-ajax-025-a-columns-initial-visibility-is-derived-from-the-grid-definition), [BR-AJAX-026](../business-rules.md#br-ajax-026-an-always-hidden-column-is-forced-server-only-others-are-cleared))
7. `LoadColumnPreferences` parses the saved `IGC_<gridId>_ColumnSelection` string and applies each remembered selection, skipping keys no longer present in the grid and columns whose mode is not `Normal`. ([BR-AJAX-027](../business-rules.md#br-ajax-027-a-saved-preference-for-a-removed-column-is-ignored), [BR-AJAX-028](../business-rules.md#br-ajax-028-always-visible-or-always-hidden-columns-cannot-be-changed))
8. `ManipulateGrid` then applies the resulting state to the live grid.
   - See [Apply column and page settings to the grid](apply-column-and-page-settings-to-the-grid.md) for the detailed logic of this sub-step.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Non-postback page load]) --> Resolve[Resolve GridCustomizers list entry by GridId]
	Resolve --> Found{Entry found?}
	Found -->|No| New[Construct new InfragisticsGridCustomizer]
	Found -->|Yes| Reuse[Reuse existing customizer]
	New --> PageSize[Determine page size: saved pref, grid pager, or default 50]
	PageSize --> Validate[Validate override column keys exist]
	Validate --> Wrap[Wrap columns as HidableInfragisticsColumn]
	Wrap --> LoadPrefs[Apply saved IGC_ ColumnSelection preferences]
	LoadPrefs --> Manipulate[ManipulateGrid applies state to live grid]
	Reuse --> Manipulate
	Manipulate --> EndOk([Grid customizer initialized])
```

## Failure and edge-case behavior
- An override column key that does not exist on the target grid throws `ApplicationException` naming the grid and the offending column. ([BR-AJAX-024](../business-rules.md#br-ajax-024-every-override-column-must-exist-on-the-target-grid))
- A missing target grid or missing object binder throws `ApplicationException` from the respective reflection property.*
- A saved column-selection preference naming a column no longer present in the grid is ignored rather than causing an error. ([BR-AJAX-027](../business-rules.md#br-ajax-027-a-saved-preference-for-a-removed-column-is-ignored))

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Presentation.Web.Controls.AJAX.Infragistics111/ModalGridCustomizer.vb`
- `SAIF.Presentation.Web.Controls.AJAX.Infragistics111/InfragisticsGridCustomizer.vb`
