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
  [Collapse]Diagrams
    Getting Started
   [Expand]Diagram Designer
    Diagram Control
   [Expand]End-User Interaction
   [Expand]Diagram Items
   [Expand]Automatic Layout
   [Expand]Data Binding Functionality
    Themes and Styles
    Printing and Exporting
    Saving and Loading Diagrams
   [Collapse]Examples
     How to: Handle DiagramControl Events to Save Diagrams to a Database instead of a File System
     How to: Create Custom Shapes with Connection Points
     How to: Create Custom Shapes with Connection Points Using XAML
     How to: Use Custom Graph Layout Algorithms to Arrange Shapes in DiagramControl
     How to: Use the CustomDrawItem Event to Draw Custom Icons Inside Diagram Items
     How to: Create a DiagramShape Descendant and Serialize Its Properties
     How to: Create Custom Diagram Containers and Register them in the Toolbox and Ribbon Gallery
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [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

How to: Create Custom Diagram Containers and Register them in the Toolbox and Ribbon Gallery

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T466447.

In this example, we show how to create containers with custom headers and padding. 
DiagramControl supports a special language for defining containers. The root element that contains a container description is ContainerShapeTemplate. This element describes a container contour and may contain several segments:
Start. Specifies the start point
Line. Defines a line with start and end points
Arc. Defines an arc with start and end points

To define a container's header editor position, use the EditorBounds property. To specify a padding, set the ActualPadding property.
To register custom containers in the ribbon gallery, use the DiagramContainerGalleryRegistrator.RegisterContainerShapes method.

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