Skip to content

Customize and apply grid column visibility and paging

This composite operation spans ModalGridCustomizer_Load, GridCustomizationPanel.OKClicked, and InfragisticsGridCustomizer.Update/ManipulateGrid/SavePreferences. It lets end users show/hide UltraWebGrid columns and control grid paging through a modal popup, optionally persisting their choices to a per-user preference store (clsPreferences).

Field Value
Operation ID OP-AJAX-006
Trigger Page load (initial grid render); end-user clicks OK or "Set as Default" in the modal popup
Inputs Target UltraWebGrid reference (TargetControls.GridId), the model's GridCustomizers collection, clsPreferences store
Outputs Mutated grid column/paging configuration; optionally persisted user preferences
Primary components ModalGridCustomizer.ModalGridCustomizer_Load, GridCustomizationPanel.OKClicked, InfragisticsGridCustomizer.Update, InfragisticsGridCustomizer.ManipulateGrid, InfragisticsGridCustomizer.SavePreferences
Entry point SAIF.Presentation.Web.Controls.AJAX.Infragistics103\ModalGridCustomizer.vb

Steps

  1. Initial load (ModalGridCustomizer_Load, handles Me.Load): if not a postback, resolves/creates the InfragisticsGridCustomizer for the target grid (GridCustomizer property — looks up an existing customizer by grid ID in the model's GridCustomizers list, or constructs a new one from the grid's current column set plus any saved column-selection/page-size preferences read from clsPreferences via keys IGC_{GridId}_ColumnSelection/IGC_{GridId}_PageSize), then calls GridCustomizer.ManipulateGrid(TargetGrid) to insert/remove UltraGridColumns from the grid's Columns collection based on stored visibility (BR-AJAX-002), and (if ControlPaging) sets inGrid.DisplayLayout.Pager.AllowPaging = True/PageSize.
  2. On failure: InfragisticsGridCustomizer construction throws ApplicationException if an always-visible/always-hidden column key does not exist on the target grid (BR-AJAX-003).
  3. Popup rendering (CustomizationPanel_AfterRender): initializes GridCustomizationPanel with the customizer's ListItems (checkbox list of columns, respecting BR-AJAX-002) and current PageSize, and wires the ModalPopupExtender's target/popup/cancel/OK control IDs.
  4. User clicks OK (GridCustomizationPanel.OKClicked, handles m_OKButton.Click): raises OKButtonClicked and BindGrid events on the panel.
  5. ModalGridCustomizer.CustomizationPanel_OKButtonClicked (handles the panel's OKButtonClicked): calls GridCustomizer.Update(checkboxListItems, pageSize) — updates in-memory HidableInfragisticsColumn.IsVisible flags and PageSize (only for columns whose VisibilityMode = Normal; AlwaysVisible/AlwaysHidden columns are immune, per BR-AJAX-002) — then re-calls ManipulateGrid(TargetGrid) to apply the new visibility/paging to the live grid.
  6. ModalGridCustomizer.CustomizationPanel_BindGrid (handles the panel's BindGrid event): rebinds the grid per BindingBehavior — ObjectBinder (calls inObjectBinder.ObjectToControl(inGrid) via clsObjectBindManager), DataBind (calls inGrid.DataBind()), or Custom (re-raises a BindGrid event for page code-behind to handle).
  7. ObjectBinder property getter throws ApplicationException if the named binder control cannot be found via Page.FindControl.
  8. User clicks "Set as Default" (GridCustomizationPanel.SetAsDefaultButton_Click, handles m_SetAsDefaultButton.Click): raises OnSavePreferences; ModalGridCustomizer.CustomizationPanel_SavePreferences handles it by calling GridCustomizer.Update(checkboxListItems, pageSize) then GridCustomizer.SavePreferences(TargetGrid, listItems, pageSize), which serializes the current ListItems into a delimited string via ColumnPreferenceList and stores it under the IGC_{GridId}_ColumnSelection/IGC_{GridId}_PageSize keys in clsPreferences, then calls Preferences.Save().
  9. Preferences.Save() and the clsPreferences indexer are provided by a referenced framework/business type (inferred SAIF.Framework.Preferences**); its own persistence mechanism (e.g., database vs. session) is not traced in this project's source and was not retrievable from this library alone.

Origin: The clsPreferences persistence mechanism referenced in step 6 is implemented in SAIF.Framework.Preferences**, not this library — its internal storage behavior is out of scope for this analysis.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Load([Page load, not postback]) --> Resolve[Resolve or create InfragisticsGridCustomizer]
    Resolve --> Manip1[ManipulateGrid applies stored column visibility/paging]
    Manip1 --> Popup[CustomizationPanel_AfterRender initializes checkbox list]
    Popup --> UserAction{User action}
    UserAction -->|Click OK| Update[GridCustomizer.Update sets IsVisible/PageSize]
    Update --> Manip2[ManipulateGrid re-applies to live grid]
    Manip2 --> BindGrid[CustomizationPanel_BindGrid rebinds per BindingBehavior]
    UserAction -->|Set as Default| Update2[GridCustomizer.Update]
    Update2 --> Save[SavePreferences writes to clsPreferences and saves]

Failure and edge-case behavior

  • TargetGrid/ObjectBinder property getters throw ApplicationException if the named grid/binder control cannot be resolved via Page.FindControl.
  • ValidateColumnVisibilitySettings throws ApplicationException if an always-visible/always-hidden column key does not exist on the target grid, per BR-AJAX-003.
  • If a previously-preferenced column was removed from or renamed in the grid, LoadColumnPreferences skips it silently rather than failing.

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.Infragistics103\ModalGridCustomizer.vb
  • SAIF.Presentation.Web.Controls.AJAX.Infragistics103\InfragisticsGridCustomizer.vb
  • SAIF.Presentation.Web.Controls.AJAX.Infragistics103\GridCustomizationPanel.vb