Customization Form - Layout Control
- 4 minutes to read
The LayoutControl allows users to modify layouts both at design time and runtime (in customization mode). The Customization Form, along with the Context Menu, contains tools for managing layouts.
This help topic describes the default Customization Form, available at design time and in default runtime customization mode.
Tip
The LayoutControl supports two runtime customization modes: “Default” and “Quick”. Refer to the following help topic for more information: Quick Runtime Customization.
Show and Hide the Customization Form
Design-Time Behavior
At design time, customization mode is always enabled. Certain customization features (for example, the ability to hide or restore layout items) are accessible only when the Customization Form is open.
To open the Customization Form:
- Right-click an empty space within the LayoutControl.
- Select “Customize Layout” from the context menu.
Runtime Behavior
At runtime, opening the Customization Form enables customization mode, which allows users to do the following:
- Hide and restore layout items
- Modify item hierarchy
- Save and load the layout
Note
End users can open the Customization Form if the LayoutControl.AllowCustomization option is enabled.
The following animation demonstrates these customization operations:
To open the Customization Form programmatically, use the LayoutControl.ShowCustomizationForm method:
layoutControl1.ShowCustomizationForm();
To close the Customization Form, users can do the following:
- Click the “Close” button on the Customization Form.
Call the HideCustomization method:
layoutControl1.HideCustomizationForm();
The LayoutControl fires the LayoutControl.HideCustomization event before the Customization Form is closed.
Customization Form Features
The Customization Form offers extensive layout modification capabilities for both developers and users. It allows users to do the following:
- Hide and restore items using drag-and-drop operations.
- Add layout elements such as Empty Space Items, Labels, Separators, and Splitters from the “Hidden Items” tab using drag-and-drop.
- Modify item properties using the built-in Properties window.
- Manage layout hierarchy by reordering items within the Layout Tree View.
- Save or restore layouts to or from XML.
- Undo or redo customization actions to revert or reapply changes.
Access and Customize the Customization Form
The Customization Form can be treated as an instance of the XtraForm. Use the LayoutControl.CustomizationForm property to access the Customization Form. You can modify the form’s caption, size, and appearance, or implement a custom Customization Form with extended functionality.
Customization Form UI
The Customization Form consists of multiple interactive elements that facilitate layout modification. The image and table below describe these UI elements and their functionality.
UI Element | Description |
---|---|
Hidden Items Tab | Displays hidden and fixed items, and supports drag-and-drop operations for managing layout elements. To hide an item, drag it from the Layout Control to this tab. To restore an item, drag it to the Layout Control. Fixed Items: The Empty Space Item, Label, Separator, and Splitter appear at the top of the list in bold. These are not actual instances, but are item types. When dragged to the layout, a new instance of the corresponding item is created. You can create custom fixed items and register them using the LayoutControl.RegisterFixedItemType method. |
Layout Tree View Tab | Displays the hierarchical structure of the Layout Control, which enables users to easily select, reorder, and modify layout items—especially those that may be obscured or too small to select with the mouse.
|
Save and Load Buttons | Allow users to save the current layout to an XML file and restore a previously saved layout. |
Undo and Redo Buttons | The “Undo” button reverts the last action, while “Redo” restores the state before the undo operation. These buttons are available only at runtime. |
Properties Window | Displays settings of the selected layout item and allows you to modify its properties. |
Use the LayoutControl.OptionsCustomizationForm property to modify the visibility of Customization Form UI elements.
// Display the Properties Window in the Customization Form
layoutControl1.OptionsCustomizationForm.ShowPropertyGrid = true;
// Hide Save/Load buttons
layoutControl1.OptionsCustomizationForm.ShowLoadButton = false;
layoutControl1.OptionsCustomizationForm.ShowSaveButton = false;