Overview

Namespace: TheTechIdea.Beep.Winform.Controls.Design.Server.Editors
Inheritance: System.Drawing.Design.UITypeEditor | Visibility: public

A design-time UITypeEditor that provides a modal dialog for adding, removing, and configuring columns on a BeepGridPro control. When the user confirms changes (DialogResult.OK), it uses reflection to force grid layout recalculation and repainting. Accessed from the Properties window when the Columns property is edited or from the smart-tag "Edit Columns..." action.

Key Methods

MethodReturn TypeDescription
GetEditStyle(context)UITypeEditorEditStyleReturns Modal -- specifies that editing opens a modal dialog
EditValue(context, provider, value)objectCasts context.Instance to BeepGridPro. Opens BeepGridColumnEditorDialog via IWindowsFormsEditorService.ShowDialog(). On DialogResult.OK, uses reflection to call grid.Layout.Recalculate() then calls Invalidate() and Refresh(). Returns the original value unchanged.

Edit Pipeline

  1. Developer clicks "..." button in the Properties window for the Columns property
  2. GetEditStyle() returns Modal
  3. EditValue() opens BeepGridColumnEditorDialog -- a full column management form
  4. Developer adds/removes/edits columns, clicks OK
  5. Editor uses reflection: grid.GetType().GetProperty("Layout").GetValue(grid).GetType().GetMethod("Recalculate").Invoke(...)
  6. grid.Invalidate() and grid.Refresh() to update the designer surface
  7. Returns the original value (the editor does not modify the value directly)

Examples

// In the Visual Studio Properties window:
// Select BeepGridPro > Columns property > click "..." button
// -> BeepGridColumnCollectionEditor opens BeepGridColumnEditorDialog
// -> Configure columns, click OK
// -> Grid layout recalculates and design surface refreshes

// The Columns property has this attribute:
[Editor(typeof(BeepGridColumnCollectionEditor), typeof(UITypeEditor))]
public BeepGridColumnConfigCollection Columns { get; set; }