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¶
- Initial load (
ModalGridCustomizer_Load, handlesMe.Load): if not a postback, resolves/creates theInfragisticsGridCustomizerfor the target grid (GridCustomizerproperty — looks up an existing customizer by grid ID in the model'sGridCustomizerslist, or constructs a new one from the grid's current column set plus any saved column-selection/page-size preferences read fromclsPreferencesvia keysIGC_{GridId}_ColumnSelection/IGC_{GridId}_PageSize), then callsGridCustomizer.ManipulateGrid(TargetGrid)to insert/removeUltraGridColumns from the grid'sColumnscollection based on stored visibility (BR-AJAX-002), and (ifControlPaging) setsinGrid.DisplayLayout.Pager.AllowPaging = True/PageSize. - On failure:
InfragisticsGridCustomizerconstruction throwsApplicationExceptionif an always-visible/always-hidden column key does not exist on the target grid (BR-AJAX-003). - Popup rendering (
CustomizationPanel_AfterRender): initializesGridCustomizationPanelwith the customizer'sListItems(checkbox list of columns, respecting BR-AJAX-002) and currentPageSize, and wires theModalPopupExtender's target/popup/cancel/OK control IDs. - User clicks OK (
GridCustomizationPanel.OKClicked, handlesm_OKButton.Click): raisesOKButtonClickedandBindGridevents on the panel. ModalGridCustomizer.CustomizationPanel_OKButtonClicked(handles the panel'sOKButtonClicked): callsGridCustomizer.Update(checkboxListItems, pageSize)— updates in-memoryHidableInfragisticsColumn.IsVisibleflags andPageSize(only for columns whoseVisibilityMode = Normal;AlwaysVisible/AlwaysHiddencolumns are immune, per BR-AJAX-002) — then re-callsManipulateGrid(TargetGrid)to apply the new visibility/paging to the live grid.ModalGridCustomizer.CustomizationPanel_BindGrid(handles the panel'sBindGridevent): rebinds the grid perBindingBehavior—ObjectBinder(callsinObjectBinder.ObjectToControl(inGrid)viaclsObjectBindManager),DataBind(callsinGrid.DataBind()), orCustom(re-raises aBindGridevent for page code-behind to handle).ObjectBinderproperty getter throwsApplicationExceptionif the named binder control cannot be found viaPage.FindControl.- User clicks "Set as Default" (
GridCustomizationPanel.SetAsDefaultButton_Click, handlesm_SetAsDefaultButton.Click): raisesOnSavePreferences;ModalGridCustomizer.CustomizationPanel_SavePreferenceshandles it by callingGridCustomizer.Update(checkboxListItems, pageSize)thenGridCustomizer.SavePreferences(TargetGrid, listItems, pageSize), which serializes the currentListItemsinto a delimited string viaColumnPreferenceListand stores it under theIGC_{GridId}_ColumnSelection/IGC_{GridId}_PageSizekeys inclsPreferences, then callsPreferences.Save(). Preferences.Save()and theclsPreferencesindexer are provided by a referenced framework/business type (inferredSAIF.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
clsPreferencespersistence mechanism referenced in step 6 is implemented inSAIF.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/ObjectBinderproperty getters throwApplicationExceptionif the named grid/binder control cannot be resolved viaPage.FindControl.ValidateColumnVisibilitySettingsthrowsApplicationExceptionif 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,
LoadColumnPreferencesskips it silently rather than failing.
Related documentation¶
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.vbSAIF.Presentation.Web.Controls.AJAX.Infragistics103\InfragisticsGridCustomizer.vbSAIF.Presentation.Web.Controls.AJAX.Infragistics103\GridCustomizationPanel.vb