Customize grid columns via the modal popup¶
This operation renders the modal popup body (column checkbox list and optional page-size editor), reacts to the user's OK/Apply/Save-as-Default choice, and rebinds or persists the resulting grid state.
| Field | Value |
|---|---|
| Operation ID | OP-AJAX-09 |
| Trigger | User clicks the customizer image, then OK / Apply / Save as Default |
| Inputs | Column checkbox selections, page-size value |
| Outputs | Grid rebound with new columns/page size; optionally persisted to clsPreferences |
| Primary components | GridCustomizationPanel events → ModalGridCustomizer handlers |
| Entry point | SAIF.Presentation.Web.Controls.AJAX.Infragistics111/GridCustomizationPanel.vb |
Steps¶
GridCustomizationPanel.CreateChildControlsbuilds the popup table (title, column checkbox list with hover help, optional page-sizeSAIFWebMaskEditmasked###, and the button row), registers/Resources/Scripts/SAIFAJAXControls.jswith a fresh GUID key, wires the Select-All / Deselect-All link buttons to the client function, and raisesAfterRender. (BR-AJAX-029, BR-AJAX-030, BR-AJAX-031)ModalGridCustomizer.CustomizationPanel_AfterRendercallsInitializewith the customizer'sListItemsand current page size, then wires theModalPopupExtender(TargetControlID= the image,PopupControlID= the panel,CancelControlID,OkControlID, drag handle = the title row) and setsOnOkScriptto a__doPostBackagainst the panel's OK button.ListItemsbuilds oneListItemper column, skippingAlwaysHiddencolumns, using the column header caption with<br>replaced by a space or — when no caption exists — the column key run throughPadCapitalLettersFormat; the item is pre-checked when the column is visible and disabled when the column isAlwaysVisible. (BR-AJAX-032, BR-AJAX-033, BR-AJAX-034)- The checkbox list's
RepeatColumnsis computed asceil(itemCount / 10)unless explicitly overridden. (BR-AJAX-035) - The Apply button is rendered only when a
LinkedRefreshControlID(a WARP) was supplied; otherwise only OK and Cancel are available. (BR-AJAX-036) - On OK/Apply the panel raises
OKButtonClickedthenBindGrid. The handler callsGridCustomizer.Updatewith the checkbox selections and the page-size value, thenManipulateGrid. (BR-AJAX-037) - See Apply column and page settings to the grid for the detailed
ManipulateGridlogic invoked here. CustomizationPanel_BindGridrebinds according toBindingBehavior:ObjectBinder→clsObjectBindManager.ObjectToControl(grid);DataBind→grid.DataBind();Custom→ re-raiseBindGridfor the page to handle. (BR-AJAX-038)ObjectBindermode delegates toSAIF.Presentation.Web.Binding.clsObjectBindManager, a sibling packaged library's object binder, to repopulate the grid from the model.
Origin: This sub-step delegates to
clsObjectBindManager.ObjectToControlimplemented inSAIF.Presentation.Web.Binding.Infragistics111and executed on behalf of this operation. 8. "Save as Default" raisesOnSavePreferences, whose handler callsUpdatethenSavePreferences— writing the column-selection string and page size intoclsPreferencesand callingPreferences.Save(). (BR-AJAX-039)
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([User clicks customizer image]) --> Popup[ModalPopupExtender shows GridCustomizationPanel]
Popup --> Render[Render checkbox list + page-size editor]
Render --> Choice{User action}
Choice -->|OK / Apply| Update[GridCustomizer.Update selections + page size]
Choice -->|Save as Default| SaveUpdate[GridCustomizer.Update]
Choice -->|Cancel| EndCancel([No change])
Update --> Manipulate[ManipulateGrid applies state]
Manipulate --> Rebind[Rebind grid per BindingBehavior]
Rebind --> EndSession([Session-only customization])
SaveUpdate --> ManipulateSave[ManipulateGrid applies state]
ManipulateSave --> Persist[SavePreferences writes clsPreferences]
Persist --> EndSaved([Preferences persisted])
Failure and edge-case behavior¶
- Confirming OK/Apply applies choices for the current session only; only "Save as Default" persists them. (BR-AJAX-037, BR-AJAX-039)
- The Apply button does not appear at all when no
LinkedRefreshControlIDwas configured, so only OK/Cancel are available. (BR-AJAX-036) BindingBehavior = Customre-raisesBindGridfor the hosting page to handle rebinding itself; if the page does not handle it, the grid is not rebound. (BR-AJAX-038)
Related documentation¶
Sources¶
SAIF.Presentation.Web.Controls.AJAX.Infragistics111/GridCustomizationPanel.vbSAIF.Presentation.Web.Controls.AJAX.Infragistics111/ModalGridCustomizer.vbSAIF.Presentation.Web.Controls.AJAX.Infragistics111/InfragisticsGridCustomizer.vb