Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Collapse]Form Layout Managers
    Side Panel
   [Collapse]Layout Manager
    [Expand]Product Information
    [Expand]Getting Started
    [Expand]Layout Control
    [Expand]Data Layout Control
    [Expand]Layout Item
    [Expand]Layout Groups
    [Expand]Tabbed Group
    [Expand]Other Layout Elements
    [Collapse]Customization Capabilities
      Design-Time Customization
      Design-Time Actions: Adding and Removing Controls and Layout Items
      Design-Time Actions: Resizing and Moving Layout Items
      Design-Time Actions: Selecting Controls and Layout Items
      Context Menu
      Customization Form
      Runtime Undo/Redo
      Creating Layout Items at Design Time
      Creating Tabbed Groups at Design Time
      Design-Time Layout Templates
      Dragging Layout Items at Design Time
      Layout Tree View
      Selecting Layout Items at Design Time
      Runtime Customization Overview
      Default Runtime Customization
      Quick Runtime Customization
    [Expand]Size and Alignment
     Flow Layout
     Table Layout
     Focus Management
    [Expand]Appearance and Look and Feel
    [Expand]Miscellaneous
    [Expand]Examples
    [Expand]Member Tables
   [Expand]Tabbed MDI Manager
    Tab Control
   [Expand]Wizard Control
    Workspace Manager
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Design-Time Layout Templates

At design time, the Layout Control's Templates feature allows you to create common and frequently-used layouts with a few mouse clicks. Predefined templates shipped with the Layout Control provide common layout solutions out of the box. In addition, you can easily create a custom template from controls in your existing project and reuse this template in other projects.

Layout templates are available in the Templates tab in the Customization Form at design time.

A template can be added to the LayoutControl using the drag-and-drop functionality. After dropping the template, all its elements are added to the LayoutControl. You can then rearrange and rename the added elements and change their settings in the Properties grid.

Expanded Predefined Templates

The LayoutControl ships with a set of predefined templates. Several examples are shown below.

Template Name Layout
2x2 TextEdit
Sign In Form
Buttons Yes, No, Cancel
Tabbed Empty Group

Expanded Custom Templates

You can combine frequently used controls into a custom template and reuse it in other projects.

To create a new layout template, do the following:

  • At design time, select one or multiple layout items and choose the Create Template command from the context menu.
    Tip

    Multiple items can be selected while holding down the SHIFT or CTRL key.

    A template can only be created from a continuous rectangular selection.

  • In the invoked Create Template dialog, type a new template name and click the Save button.

After that, the template will be available in the Customization Form's Templates tab.

All custom templates are stored in the %Public%\Documents\DevExpress\XtraLayout\UserTemplates folder as XML files. If you wish to remove a specific custom template from the LayoutControl’s Customization Form, delete the corresponding XML file.

Expanded Saving and Restoring Templates Notes

Take note of the following while saving and restoring templates.

  • A template can only be created from a continuous rectangular selection.
  • If a template contains a binding to a DataSet or an external assembly reference, the LayoutControl tries to remove this binding while restoring the template.
  • If you created a template with a UserControl, you can restore this control only in the same project. In other projects, the LayoutControl removes this UserControl when the template is restored.
  • If a template contains links to images from project resources, these images are not restored from this template. However, the LayoutControl supports saving and restoring images from form resources.
  • Event handlers are not included in templates.

Expanded See Also

How would you rate this topic?​​​​​​​