Skip to content

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

  1. GridCustomizationPanel.CreateChildControls builds the popup table (title, column checkbox list with hover help, optional page-size SAIFWebMaskEdit masked ###, and the button row), registers /Resources/Scripts/SAIFAJAXControls.js with a fresh GUID key, wires the Select-All / Deselect-All link buttons to the client function, and raises AfterRender. (BR-AJAX-029, BR-AJAX-030, BR-AJAX-031)
  2. ModalGridCustomizer.CustomizationPanel_AfterRender calls Initialize with the customizer's ListItems and current page size, then wires the ModalPopupExtender (TargetControlID = the image, PopupControlID = the panel, CancelControlID, OkControlID, drag handle = the title row) and sets OnOkScript to a __doPostBack against the panel's OK button.
  3. ListItems builds one ListItem per column, skipping AlwaysHidden columns, using the column header caption with <br> replaced by a space or — when no caption exists — the column key run through PadCapitalLettersFormat; the item is pre-checked when the column is visible and disabled when the column is AlwaysVisible. (BR-AJAX-032, BR-AJAX-033, BR-AJAX-034)
  4. The checkbox list's RepeatColumns is computed as ceil(itemCount / 10) unless explicitly overridden. (BR-AJAX-035)
  5. The Apply button is rendered only when a LinkedRefreshControlID (a WARP) was supplied; otherwise only OK and Cancel are available. (BR-AJAX-036)
  6. On OK/Apply the panel raises OKButtonClicked then BindGrid. The handler calls GridCustomizer.Update with the checkbox selections and the page-size value, then ManipulateGrid. (BR-AJAX-037)
  7. See Apply column and page settings to the grid for the detailed ManipulateGrid logic invoked here.
  8. CustomizationPanel_BindGrid rebinds according to BindingBehavior: ObjectBinder → clsObjectBindManager.ObjectToControl(grid); DataBind → grid.DataBind(); Custom → re-raise BindGrid for the page to handle. (BR-AJAX-038)
  9. ObjectBinder mode delegates to SAIF.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.ObjectToControl implemented in SAIF.Presentation.Web.Binding.Infragistics111 and executed on behalf of this operation. 8. "Save as Default" raises OnSavePreferences, whose handler calls Update then SavePreferences — writing the column-selection string and page size into clsPreferences and calling Preferences.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 LinkedRefreshControlID was configured, so only OK/Cancel are available. (BR-AJAX-036)
  • BindingBehavior = Custom re-raises BindGrid for the hosting page to handle rebinding itself; if the page does not handle it, the grid is not rebound. (BR-AJAX-038)

Sources

  • SAIF.Presentation.Web.Controls.AJAX.Infragistics111/GridCustomizationPanel.vb
  • SAIF.Presentation.Web.Controls.AJAX.Infragistics111/ModalGridCustomizer.vb
  • SAIF.Presentation.Web.Controls.AJAX.Infragistics111/InfragisticsGridCustomizer.vb