Class RadDiagram
Represents a powerful diagramming control that allows visualization and editing of diagrams, flowcharts, organizational charts, and other visual graph structures. Provides functionality for creating, connecting, and manipulating shapes within a canvas.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.RadDiagram.dll
Syntax
[TelerikToolboxCategory("Diagram")]
public class RadDiagram : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider, IPrintable
  Constructors
RadDiagram()
Initializes a new instance of the RadDiagram class. Sets up the control with default settings and enables gesture support.
Declaration
public RadDiagram()
  Properties
ActiveTool
Gets or sets the tool which is active when interacting with the diagram elements.
Declaration
public MouseTool ActiveTool { get; set; }
  Property Value
| 
        MouseTool
         
  | 
    
AllowCopy
Gets or sets a value indicating whether copying is allowed.
Declaration
public bool AllowCopy { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
AllowCut
Gets or sets a value indicating whether cutting is allowed.
Declaration
public bool AllowCut { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
AllowDelete
Gets or sets a value indicating whether deleting is allowed.
Declaration
public bool AllowDelete { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
AllowPaste
Gets or sets a value indicating whether pasting is allowed.
Declaration
public bool AllowPaste { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
AutoLayout
Gets or sets the auto layout.
Declaration
public bool AutoLayout { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
AutoSize
Gets or sets whether the edit control is auto-sized
Declaration
public override bool AutoSize { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
Overrides
BackgroundGrid
BackgroundPageGrid
Declaration
public virtual BackgroundPageGrid BackgroundPageGrid { get; }
  Property Value
| 
        BackgroundPageGrid
         
  | 
    
ConnectionBridge
Gets or sets the connection bridge type.
Declaration
public BridgeType ConnectionBridge { get; set; }
  Property Value
| 
        BridgeType
         
  | 
    
ConnectionDataMember
Gets or sets the links data member.
Declaration
public string ConnectionDataMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ConnectionRoundedCorners
Gets or sets whether the corners of the (polyline) connection are rounded.
Declaration
public bool ConnectionRoundedCorners { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
Remarks
This property has only an effect when the ConnectionType is set to Polyline.
Connections
Gets the connections.
Declaration
public ConnectionCollection Connections { get; }
  Property Value
| 
        ConnectionCollection
         
  | 
    
ConnectionSourceCapTypeMember
Gets or sets the ConnectionSourceCapTypeMember data member.
Declaration
public string ConnectionSourceCapTypeMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ConnectionSourceConnectorMember
Gets or sets the SourceConnector data member.
Declaration
public string ConnectionSourceConnectorMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ConnectionSourceShapeIdMember
Gets or sets the ConnectionTargetShapeIdMember data member.
Declaration
public string ConnectionSourceShapeIdMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ConnectionTargetCapTypeMember
Gets or sets the ConnectionTargetCapTypeMember data member.
Declaration
public string ConnectionTargetCapTypeMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ConnectionTargetConnectorMember
Gets or sets the Target connector data member.
Declaration
public string ConnectionTargetConnectorMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ConnectionTargetShapeIdMember
Gets or sets the ConnectionTargetShapeIdMember data member.
Declaration
public string ConnectionTargetShapeIdMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ConnectionTextMember
Gets or sets the ConnectionTextMember data member.
Declaration
public string ConnectionTextMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ContainerGenerator
Gets the container generator.
Declaration
public IContainerGenerator<RadDiagramItem> ContainerGenerator { get; }
  Property Value
| 
        IContainerGenerator<RadDiagramItem>
         
  | 
    
DataSource
Gets or sets the data source of the RadDiagram.
Declaration
public object DataSource { get; set; }
  Property Value
| 
        System.Object
         
  | 
    
DefaultSize
Gets the default size of the RadDiagram control.
Declaration
protected override Size DefaultSize { get; }
  Property Value
| 
        System.Drawing.Size
         A System.Drawing.Size object representing the default size of the control.  | 
    
DiagramElement
DisplayMemberPath
Gets or sets the display member path.
Declaration
public string DisplayMemberPath { get; set; }
  Property Value
| 
        System.String
         The display member path.  | 
    
GraphSource
Gets or sets the graph source.
Declaration
public IGraphSource GraphSource { get; set; }
  Property Value
| 
        IGraphSource
         The graph source.  | 
    
Groups
Gets the group collection.
Declaration
public IEnumerable<IGroup> Groups { get; }
  Property Value
| 
        System.Collections.Generic.IEnumerable<IGroup>
         
  | 
    
HorizontalScrollbarVisibility
Declaration
public ScrollBarVisibility HorizontalScrollbarVisibility { get; set; }
  Property Value
| 
        ScrollBarVisibility
         
  | 
    
IsBackgroundSurfaceVisible
Gets or sets whether the background grid is visible.
Declaration
public bool IsBackgroundSurfaceVisible { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsConnectorsManipulationEnabled
Gets or sets a value indicating whether manipulation on the connectors is enabled.
Declaration
public bool IsConnectorsManipulationEnabled { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsDataBound
Gets a value indicating whether this instance is data bound.
Declaration
public bool IsDataBound { get; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsDraggingEnabled
Gets or sets a value indicating whether dragging is enabled.
Declaration
public bool IsDraggingEnabled { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsEditable
Gets or sets a value indicating whether editing is enabled.
Declaration
public bool IsEditable { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsInformationAdornerVisible
Gets or sets whether the information adorner is visible.
Declaration
public bool IsInformationAdornerVisible { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsManipulationAdornerVisible
Gets or sets a value indicating whether the manipulation adorner is visible.
Declaration
public bool IsManipulationAdornerVisible { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsMouseCaptured
Gets or sets a value indicating whether the mouse is captured.
Declaration
public bool IsMouseCaptured { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsPanEnabled
Gets or sets a value indicating whether panning is enabled.
Declaration
public bool IsPanEnabled { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsResizingEnabled
Gets or sets a value indicating whether resizing is enabled.
Declaration
public bool IsResizingEnabled { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsRotationEnabled
Gets or sets a value indicating whether rotation is enabled.
Declaration
public bool IsRotationEnabled { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsSettingsPaneEnabled
Hide or Show the Settings pane button.
Declaration
public bool IsSettingsPaneEnabled { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsSnapToGridEnabled
Gets or sets a value indicating whether grid snapping is enabled.
Declaration
public bool IsSnapToGridEnabled { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsSnapToItemsEnabled
Gets or sets a value indicating whether snapping of selected item(s) to the other items in the view port is enabled or not.
Declaration
public bool IsSnapToItemsEnabled { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
IsZoomEnabled
Gets or sets a value indicating whether zooming is enabled.
Declaration
public bool IsZoomEnabled { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
Items
Gets or sets the diagramming items.
Declaration
public DiagramItemCollection Items { get; }
  Property Value
| 
        DiagramItemCollection
         The items.  | 
    
Metadata
Gets the diagram metadata.
Declaration
public DiagramMetadata Metadata { get; }
  Property Value
| 
        DiagramMetadata
         
  | 
    
Position
Gets or sets the position.
Declaration
public Point Position { get; set; }
  Property Value
| 
        Point
         ; The position.  | 
    
RectSelectionMode
Gets or sets the rectangle selection mode.
Declaration
public RectSelectionMode RectSelectionMode { get; set; }
  Property Value
| 
        RectSelectionMode
         
  | 
    
RightToLeft
This property is not supported in RadDiagram and is hidden from designers and IntelliSense.
Declaration
public override RightToLeft RightToLeft { get; set; }
  Property Value
| 
        System.Windows.Forms.RightToLeft
         
  | 
    
Remarks
Right-to-left layout is not supported in RadDiagram components due to specific layout requirements.
RouteConnections
Declaration
public bool RouteConnections { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
Remarks
Setting this property has no effect on other connection types.
RoutingService
SelectedIndex
Gets or sets the index of the first item in the current selection or returns negative one (-1) if the selection is empty.
Declaration
public int SelectedIndex { get; set; }
  Property Value
| 
        System.Int32
         
  | 
    
SelectedItem
Gets or sets the first item in the current selection or returns null if the selection is empty. This is a dependency property.
Declaration
public object SelectedItem { get; set; }
  Property Value
| 
        System.Object
         
  | 
    
SelectedItems
Gets the selected items.
Declaration
public IEnumerable<IDiagramItem> SelectedItems { get; }
  Property Value
| 
        System.Collections.Generic.IEnumerable<IDiagramItem>
         
  | 
    
SelectionBounds
Gets the starting selection bounds.
Declaration
public Rect SelectionBounds { get; }
  Property Value
| 
        Rect
         
  | 
    
SelectionMode
Gets or sets the selection mode.
Declaration
public SelectionMode SelectionMode { get; set; }
  Property Value
| 
        SelectionMode
         
  | 
    
SerializedXml
Declaration
public string SerializedXml { get; set; }
  Property Value
| 
        System.String
         
  | 
    
ServiceLocator
Gets the service locator.
Declaration
public IServiceLocator ServiceLocator { get; }
  Property Value
| 
        IServiceLocator
         
  | 
    
ShapeDataMember
Gets or sets the links data member.
Declaration
public string ShapeDataMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ShapeHeightMember
Gets or sets the Shape height data member.
Declaration
public string ShapeHeightMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ShapeIdMember
Gets or sets the ID data member.
Declaration
public string ShapeIdMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
Shapes
ShapeTextMember
Gets or sets the links data member.
Declaration
public string ShapeTextMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ShapeTypeMember
Gets or sets the Shape data member.
Declaration
public string ShapeTypeMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ShapeWidthMember
Gets or sets the Shape height data member.
Declaration
public string ShapeWidthMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ShapeXMember
Gets or sets the Shape X position data member.
Declaration
public string ShapeXMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
ShapeYMember
Gets or sets the Shape Y position data member.
Declaration
public string ShapeYMember { get; set; }
  Property Value
| 
        System.String
         The data member.  | 
    
SnapX
Gets or sets the horizontal snapping distance.
Declaration
public int SnapX { get; set; }
  Property Value
| 
        System.Int32
         The horizontal snapping distance.  | 
    
SnapY
Gets or sets the vertical snapping distance.
Declaration
public int SnapY { get; set; }
  Property Value
| 
        System.Int32
         The vertical snapping distance.  | 
    
UndoRedoService
Gets the undo redo service.
Declaration
public IUndoRedoService UndoRedoService { get; }
  Property Value
| 
        IUndoRedoService
         
  | 
    
VerticalScrollbarVisibility
Declaration
public ScrollBarVisibility VerticalScrollbarVisibility { get; set; }
  Property Value
| 
        ScrollBarVisibility
         
  | 
    
Viewport
Zoom
Gets or sets the zoom. A zoom value of 1 means 100% and less then 1 means a zoom out. Zoom value will be coerced to be greater than zero, not infinity and not Nan. In addition, Zoom value will be coerced to be greater or equal than MinimumZoom and smaller or equal than MaximumZoom.
Declaration
public double Zoom { get; set; }
  Property Value
| 
        System.Double
         
  | 
    
Methods
AddConnection(IConnection, Boolean)
Adds a new connection to the diagram.
Declaration
public IConnection AddConnection(IConnection connection, bool isUndoable = false)
  Parameters
| 
        IConnection
        connection
         The connection to be added.  | 
    
| 
        System.Boolean
        isUndoable
         If set to   | 
    
Returns
| 
        IConnection
         
  | 
    
AddConnection(IShape, IShape, Boolean)
Adds a new connection to the diagram connecting the given source and target shapes.
Declaration
public IConnection AddConnection(IShape source, IShape target, bool isUndoable = false)
  Parameters
| 
        IShape
        source
         The source or start shape of the connection.  | 
    
| 
        IShape
        target
         The target or end shape of the connection.  | 
    
| 
        System.Boolean
        isUndoable
         If set to   | 
    
Returns
| 
        IConnection
         
  | 
    
AddConnection(IShape, IShape, String, Boolean)
Adds a new connection to the diagram connecting the given source and target shapes.
Declaration
public IConnection AddConnection(IShape source, IShape target, string connectorsPosition, bool isUndoable = false)
  Parameters
| 
        IShape
        source
         The source or start shape of the connection.  | 
    
| 
        IShape
        target
         The target or end shape of the connection.  | 
    
| 
        System.String
        connectorsPosition
         The connectors position.  | 
    
| 
        System.Boolean
        isUndoable
         If set to   | 
    
Returns
| 
        IConnection
         
  | 
    
AddConnection(IShape, IShape, String, String, Boolean)
Adds a new connection to the diagram connecting the given source and target shapes.
Declaration
public IConnection AddConnection(IShape source, IShape target, string sourceConnector, string targetConnector, bool isUndoable = false)
  Parameters
| 
        IShape
        source
         The source.  | 
    
| 
        IShape
        target
         The target.  | 
    
| 
        System.String
        sourceConnector
         The source connector position.  | 
    
| 
        System.String
        targetConnector
         The target connector position.  | 
    
| 
        System.Boolean
        isUndoable
         If set to   | 
    
Returns
| 
        IConnection
         
  | 
    
AddConnection(Point, Point, Boolean)
Adds a floating connection.
Declaration
public IConnection AddConnection(Point startPoint, Point endPoint, bool isUndoable = false)
  Parameters
| 
        Point
        startPoint
         The source (starting) point of the connection.  | 
    
| 
        Point
        endPoint
         The target (end) point of the connection.  | 
    
| 
        System.Boolean
        isUndoable
         True, if this action is undoable.  | 
    
Returns
| 
        IConnection
         Returns the added connection.  | 
    
AddGlidingConnection(IShape, IShape, Boolean)
Adds a new gliding connection to the diagram connecting the given source and target shapes.
Declaration
public IConnection AddGlidingConnection(IShape source, IShape target, bool isUndoable = false)
  Parameters
| 
        IShape
        source
         The source or start shape of the connection.  | 
    
| 
        IShape
        target
         The target or end shape of the connection.  | 
    
| 
        System.Boolean
        isUndoable
         If set to   | 
    
Returns
| 
        IConnection
         
  | 
    
Remarks
If the shape already contains connections on the default connectors this will raise an exception since gliding connections are mutually exclusive with normal connections. Remove first the existing connections on the source and target shapes before calling this method.
AddShape(Object, Geometry, Nullable<Point>, Boolean)
Adds a new shape to the diagram.
Declaration
public IShape AddShape(object content, Geometry geometry = null, Point? position = default(Point? ), bool isUndoable = false)
  Parameters
| 
        System.Object
        content
         The content of the shape.  | 
    
| 
        Geometry
        geometry
         The geometry.  | 
    
| 
        System.Nullable<Point>
        position
         The position.  | 
    
| 
        System.Boolean
        isUndoable
         If set to   | 
    
Returns
| 
        IShape
         The added shape.  | 
    
Remarks
The given object will be inserted as the content of a new RadDiagramShape and will internally uniquely identify the shape. Alternatively, you can instantiate a new shape and use this same AddShape method to add it to the diagram, in which case the shape rather than the content will uniquely identify it internally.
AddShape(IShape, Nullable<Point>, Boolean)
Adds the given shape to the diagram.
Declaration
public IShape AddShape(IShape shape, Point? position = default(Point? ), bool isUndoable = false)
  Parameters
| 
        IShape
        shape
         The shape to add.  | 
    
| 
        System.Nullable<Point>
        position
         The position at which the shape will be added on the canvas.  | 
    
| 
        System.Boolean
        isUndoable
         If set to   | 
    
Returns
| 
        IShape
         
  | 
    
Align(Alignment, IEnumerable<IShape>)
Aligns the given shapes.
Declaration
public void Align(Alignment alignment, IEnumerable<IShape> shapes)
  Parameters
| 
        Alignment
        alignment
         
  | 
    
| 
        System.Collections.Generic.IEnumerable<IShape>
        shapes
         
  | 
    
BeginBatchTransformation()
Begins a batch transformation and signals the undo-redo stack that a batch of transformation should be considered as one, i.e. a composite change.
Declaration
public DiagramLayoutState BeginBatchTransformation()
  Returns
| 
        DiagramLayoutState
         
  | 
    
See Also
BeginInit()
Suspends layout operations during initialization of the diagram control. Prevents unnecessary updates while multiple properties are being set.
Declaration
public override void BeginInit()
  Overrides
BeginPrint(RadPrintDocument, PrintEventArgs)
Declaration
public int BeginPrint(RadPrintDocument sender, PrintEventArgs args)
  Parameters
| 
        RadPrintDocument
        sender
         
  | 
    
| 
        System.Drawing.Printing.PrintEventArgs
        args
         
  | 
    
Returns
| 
        System.Int32
         
  | 
    
Implements
BringForward(IEnumerable<IDiagramItem>, Boolean)
Brings the items forward.
Declaration
public void BringForward(IEnumerable<IDiagramItem> items, bool isUndoable = true)
  Parameters
| 
        System.Collections.Generic.IEnumerable<IDiagramItem>
        items
         
  | 
    
| 
        System.Boolean
        isUndoable
         
  | 
    
BringToFront(IEnumerable<IDiagramItem>, Boolean)
Brings the items to front.
Declaration
public void BringToFront(IEnumerable<IDiagramItem> items, bool isUndoable = true)
  Parameters
| 
        System.Collections.Generic.IEnumerable<IDiagramItem>
        items
         
  | 
    
| 
        System.Boolean
        isUndoable
         
  | 
    
Clear()
Clears the diagram and resets the document.
Declaration
public void Clear()
  Remarks
The diagram is not saved prior to this reset. You need to handle in the application the eventual necessity to save (or request the user) the diagram before this.
CommitBatchTransformation(DiagramLayoutState, DiagramLayoutState, Boolean, Boolean, LayoutType, Object)
Commits the batch transformation and ends the composite undo redo change.
Declaration
public void CommitBatchTransformation(DiagramLayoutState initialState, DiagramLayoutState finalState, bool animate = false, bool execute = true, LayoutType type = LayoutType.Sugiyama, object settings = null)
  Parameters
| 
        DiagramLayoutState
        initialState
         The initial state.  | 
    
| 
        DiagramLayoutState
        finalState
         The final state.  | 
    
| 
        System.Boolean
        animate
         If set to   | 
    
| 
        System.Boolean
        execute
         Whether the undo-redo unit is only added or also executed.  | 
    
| 
        LayoutType
        type
         The layout type that has been applied.  | 
    
| 
        System.Object
        settings
         The layout specific settings used for the layout.  | 
    
Remarks
The animation tremendously decreases the performance.
See Also
Copy()
Copies the currently selected items of the diagram.
Declaration
public void Copy()
  CreateChildItems(RadElement)
Creates and initializes the child elements of the RadDiagram control. Initializes and adds the diagram element to the control's element tree.
Declaration
protected override void CreateChildItems(RadElement parent)
  Parameters
| 
        RadElement
        parent
         The parent element that contains the child items.  | 
    
Overrides
CreateDiagramElement()
Creates a new instance of the RadDiagramElement class that will be used as the main visual element of the diagram control.
Declaration
protected virtual RadDiagramElement CreateDiagramElement()
  Returns
| 
        RadDiagramElement
         A new instance of RadDiagramElement.  | 
    
Cut()
Cuts the currently selected items of the diagram.
Declaration
public void Cut()
  Delete()
Deletes the currently selected items of the diagram.
Declaration
public virtual void Delete()
  DeselectAll()
Deselects all shapes in the diagram.
Declaration
public void DeselectAll()
  Deserialize(SerializationInfo)
Deserializes the specified info.
Declaration
public virtual void Deserialize(SerializationInfo info)
  Parameters
| 
        SerializationInfo
        info
         The info.  | 
    
EndInit()
Resumes layout operations after initialization of the diagram control. Updates the diagram element and applies any pending changes.
Declaration
public override void EndInit()
  Overrides
EndPrint(RadPrintDocument, PrintEventArgs)
Declaration
public bool EndPrint(RadPrintDocument sender, PrintEventArgs args)
  Parameters
| 
        RadPrintDocument
        sender
         
  | 
    
| 
        System.Drawing.Printing.PrintEventArgs
        args
         
  | 
    
Returns
| 
        System.Boolean
         
  | 
    
Implements
ExportToImage()
Exports RadDiagram to Image
Declaration
public Image ExportToImage()
  Returns
| 
        System.Drawing.Image
         The Image. Should be manually disposed.  | 
    
ExportToImage(Size)
Exports the RadDiagram into the specified stream.
Declaration
[Obsolete("Use ExportToImage() method instead")]
public Image ExportToImage(Size size)
  Parameters
| 
        System.Drawing.Size
        size
         The size of the exported image.  | 
    
Returns
| 
        System.Drawing.Image
         
  | 
    
ForceRefresh()
Refreshes ScrollBars and Background grids
Declaration
public void ForceRefresh()
  GetSettingsDialog(RadPrintDocument)
Declaration
public Form GetSettingsDialog(RadPrintDocument document)
  Parameters
| 
        RadPrintDocument
        document
         
  | 
    
Returns
| 
        System.Windows.Forms.Form
         
  | 
    
Implements
Group(String, Boolean, IGroupable[])
Groups the specified items.
Declaration
public IGroup Group(string groupName = null, bool isUndoable = false, params IGroupable[] items)
  Parameters
| 
        System.String
        groupName
         Name of the new group.  | 
    
| 
        System.Boolean
        isUndoable
         If set to   | 
    
| 
        IGroupable[]
        items
         The groups items to ungroup.  | 
    
Returns
| 
        IGroup
         
  | 
    
Group(String, IGroupable[])
Groups the specified items.
Declaration
public IGroup Group(string groupName = null, params IGroupable[] items)
  Parameters
| 
        System.String
        groupName
         Name of the new group.  | 
    
| 
        IGroupable[]
        items
         The groups items to ungroup.  | 
    
Returns
| 
        IGroup
         
  | 
    
IsInputKey(Keys)
Determines whether the specified key is an input key or a regular key for the control. Enables arrow keys and shift+arrow key combinations to be handled by the control.
Declaration
protected override bool IsInputKey(Keys keyData)
  Parameters
| 
        System.Windows.Forms.Keys
        keyData
         A System.Windows.Forms.Keys value that represents the key to check.  | 
    
Returns
| 
        System.Boolean
         
  | 
    
Overrides
IsInViewport(IDiagramItem)
Checks if the diagram item is in the viewport.
Declaration
public bool IsInViewport(IDiagramItem item)
  Parameters
| 
        IDiagramItem
        item
         
  | 
    
Returns
| 
        System.Boolean
         
  | 
    
LayoutAsync(LayoutType, Object)
Organizes the diagram using the specified layout asynchronously.
Declaration
public void LayoutAsync(LayoutType type = LayoutType.Sugiyama, object settings = null)
  Parameters
| 
        LayoutType
        type
         The layout type to apply.  | 
    
| 
        System.Object
        settings
         The settings specific to the layout type.  | 
    
See Also
Load(String)
Loads the specified serialization string.
Declaration
public void Load(string serializationValue)
  Parameters
| 
        System.String
        serializationValue
         The serialization value.  | 
    
LoadFromFile(String)
Load Diagram to XML file
Declaration
public void LoadFromFile(string fileName)
  Parameters
| 
        System.String
        fileName
         
  | 
    
OnBindingContextChanged(EventArgs)
Raises the System.Windows.Forms.Control.BindingContextChanged event and updates the diagram element's binding context. Ensures that binding context changes are propagated to child elements.
Declaration
protected override void OnBindingContextChanged(EventArgs e)
  Parameters
| 
        System.EventArgs
        e
         An System.EventArgs that contains the event data.  | 
    
Overrides
OnKeyDown(KeyEventArgs)
Raises the System.Windows.Forms.Control.KeyDown event and processes keyboard input for the diagram. Forwards key events to the diagram element for handling, unless a text editor is active.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
  Parameters
| 
        System.Windows.Forms.KeyEventArgs
        e
         A System.Windows.Forms.KeyEventArgs that contains the event data.  | 
    
Overrides
OnMouseDown(MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseDown event and handles mouse down interactions for the diagram. Delegates mouse handling to the diagram element's input behavior system.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
  Parameters
| 
        System.Windows.Forms.MouseEventArgs
        e
         A System.Windows.Forms.MouseEventArgs that contains the event data.  | 
    
Overrides
OnMouseMove(MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseMove event and handles mouse movement interactions for the diagram. Delegates mouse movement handling to the diagram element's input behavior system.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
  Parameters
| 
        System.Windows.Forms.MouseEventArgs
        e
         A System.Windows.Forms.MouseEventArgs that contains the event data.  | 
    
Overrides
OnMouseUp(MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseUp event and handles mouse release interactions for the diagram. Delegates mouse up handling to the diagram element's input behavior system.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
  Parameters
| 
        System.Windows.Forms.MouseEventArgs
        e
         A System.Windows.Forms.MouseEventArgs that contains the event data.  | 
    
Overrides
OnPaintBackground(PaintEventArgs)
Raises the paint background event and handles special drawing requirements. Detects changes in the clipping rectangle and triggers a redraw when necessary.
Declaration
protected override void OnPaintBackground(PaintEventArgs e)
  Parameters
| 
        System.Windows.Forms.PaintEventArgs
        e
         A System.Windows.Forms.PaintEventArgs that contains the event data.  | 
    
OnVisibleChanged(EventArgs)
Raises the System.Windows.Forms.Control.VisibleChanged event and performs necessary updates when visibility changes. Refreshes the diagram when the control becomes visible.
Declaration
protected override void OnVisibleChanged(EventArgs e)
  Parameters
| 
        System.EventArgs
        e
         An System.EventArgs that contains the event data.  | 
    
Overrides
PanToPosition(Point)
Pans the diagram to the provided position. The values are interpreted in the zoomed coordinate system. This means that panning with 100 pixel will result in visual translation with 100 pixel.
Declaration
public virtual void PanToPosition(Point newPosition)
  Parameters
| 
        Point
        newPosition
         The new position coordinates to pan the diagram to.  | 
    
Paste()
Pastes the content of the clipboard onto the diagram.
Declaration
public virtual void Paste()
  Print()
Print(Boolean)
Directly prints the RadDiagram to the default printer or shows printer settings and then prints the RadDiagram.
Declaration
public virtual void Print(bool showPrinterSettings)
  Parameters
| 
        System.Boolean
        showPrinterSettings
         Indicates whether printer settings dialog should be shown.  | 
    
Print(Boolean, RadPrintDocument)
Directly prints the RadDiagram to the default printer or shows printer settings and then prints the RadDiagram.
Declaration
public virtual void Print(bool showPrinterSettings, RadPrintDocument document)
  Parameters
| 
        System.Boolean
        showPrinterSettings
         Indicates whether printer settings dialog should be shown.  | 
    
| 
        RadPrintDocument
        document
         As instance of RadPrintDocument used to control the print process.  | 
    
PrintPage(Int32, RadPrintDocument, PrintPageEventArgs)
Declaration
public bool PrintPage(int pageNumber, RadPrintDocument sender, PrintPageEventArgs args)
  Parameters
| 
        System.Int32
        pageNumber
         
  | 
    
| 
        RadPrintDocument
        sender
         
  | 
    
| 
        System.Drawing.Printing.PrintPageEventArgs
        args
         
  | 
    
Returns
| 
        System.Boolean
         
  | 
    
Implements
PrintPreview()
Shows a RadPrintPreviewDialog for editing print settings.
Declaration
public virtual void PrintPreview()
  PrintPreview(RadPrintDocument)
Shows a RadPrintPreviewDialog for editing print settings.
Declaration
public virtual void PrintPreview(RadPrintDocument document)
  Parameters
| 
        RadPrintDocument
        document
         As instance of RadPrintDocument used to control the print process.  | 
    
ProcessAutoSizeChanged(Boolean)
Overrides the base implementation of ProcessAutoSizeChanged. This method is intentionally empty as RadDiagram does not support auto-sizing.
Declaration
protected override void ProcessAutoSizeChanged(bool value)
  Parameters
| 
        System.Boolean
        value
         A boolean value indicating whether auto-size is enabled.  | 
    
Overrides
Redo()
Performs redo on the last undone action.
Declaration
public void Redo()
  RemoveConnection(IConnection, Boolean)
Removes the connection.
Declaration
public void RemoveConnection(IConnection connection, bool isUndoable = false)
  Parameters
| 
        IConnection
        connection
         The connection.  | 
    
| 
        System.Boolean
        isUndoable
         If set to   | 
    
RemoveShape(IShape, Boolean)
Removes the shape.
Declaration
public void RemoveShape(IShape shape, bool isUndoable = false)
  Parameters
| 
        IShape
        shape
         The shape.  | 
    
| 
        System.Boolean
        isUndoable
         If set to   | 
    
Save()
Saves the diagram.
Declaration
public string Save()
  Returns
| 
        System.String
         Returns the serialization string.  | 
    
SaveToFile(String)
Save Diagram to XML file
Declaration
public void SaveToFile(string fileName)
  Parameters
| 
        System.String
        fileName
         
  | 
    
SelectAll()
Selects all shapes in the diagram.
Declaration
public void SelectAll()
  SendBackward(IEnumerable<IDiagramItem>, Boolean)
Sends the items backward.
Declaration
public void SendBackward(IEnumerable<IDiagramItem> items, bool isUndoable = true)
  Parameters
| 
        System.Collections.Generic.IEnumerable<IDiagramItem>
        items
         
  | 
    
| 
        System.Boolean
        isUndoable
         
  | 
    
SendToBack(IEnumerable<IDiagramItem>, Boolean)
Sends the items to back.
Declaration
public void SendToBack(IEnumerable<IDiagramItem> items, bool isUndoable = true)
  Parameters
| 
        System.Collections.Generic.IEnumerable<IDiagramItem>
        items
         
  | 
    
| 
        System.Boolean
        isUndoable
         
  | 
    
Serialize()
Serializes this instance.
Declaration
public virtual SerializationInfo Serialize()
  Returns
| 
        SerializationInfo
         
  | 
    
SetLayout(LayoutType, Object)
Organizes the diagram using the specified layout.
Declaration
public void SetLayout(LayoutType type = LayoutType.Sugiyama, object settings = null)
  Parameters
| 
        LayoutType
        type
         The layout type to apply.  | 
    
| 
        System.Object
        settings
         The settings specific to the layout type.  | 
    
See Also
Snap(IEnumerable<IShape>)
Snaps the specified shapes.
Declaration
public void Snap(IEnumerable<IShape> shapes)
  Parameters
| 
        System.Collections.Generic.IEnumerable<IShape>
        shapes
         
  | 
    
Undo()
Performs undo on the last action.
Declaration
public void Undo()
  Ungroup(Boolean, IGroup[])
Ungroups the specified items.
Declaration
public void Ungroup(bool isUndoable, params IGroup[] groups)
  Parameters
| 
        System.Boolean
        isUndoable
         If set to   | 
    
| 
        IGroup[]
        groups
         The groups items to ungroup.  | 
    
Ungroup(IGroup[])
Ungroups the specified items.
Declaration
public void Ungroup(params IGroup[] groups)
  Parameters
| 
        IGroup[]
        groups
         The groups items to ungroup.  | 
    
ZoomIn(Nullable<Double>, Nullable<Point>)
Zooms in the diagram. Simulates zooming with the mouse. Performs incremental zoom taking into account previous zoom operations.
Declaration
public virtual void ZoomIn(double? factor = default(double? ), Point? targetPoint = default(Point? ))
  Parameters
| 
        System.Nullable<System.Double>
        factor
         The value by which to change Zoom property. When factor is null, smaller or equal to zero the ZoomFactor value will be used.  | 
    
| 
        System.Nullable<Point>
        targetPoint
         The center of the zoom. The point should be provided in viewport coordinates.  | 
    
ZoomOut(Nullable<Double>, Nullable<Point>)
Zooms out the diagram. Simulates zooming with the mouse. Performs incremental zoom taking into account previous zoom operations.
Declaration
public virtual void ZoomOut(double? factor = default(double? ), Point? targetPoint = default(Point? ))
  Parameters
| 
        System.Nullable<System.Double>
        factor
         The value by which to change Zoom property. When factor is null, smaller or equal to zero the ZoomFactor value will be used.  | 
    
| 
        System.Nullable<Point>
        targetPoint
         The center of the zoom. The point should be provided in viewport coordinates.  | 
    
Events
AdditionalContentActivated
Occurs when AdditionContent is activated.
Declaration
public event EventHandler<AdditionalContentActivatedEventArgs> AdditionalContentActivated
  Event Type
| 
        System.EventHandler<AdditionalContentActivatedEventArgs>
         
  | 
    
CommandExecuted
Occurs when a async command is executed.
Declaration
public event EventHandler<CommandEventArgs> CommandExecuted
  Event Type
| 
        System.EventHandler<CommandEventArgs>
         
  | 
    
ConnectionAdded
Occurs when a connection is added.
Declaration
public event EventHandler<GenericEventArgs<IConnection>> ConnectionAdded
  Event Type
| 
        System.EventHandler<GenericEventArgs<IConnection>>
         
  | 
    
ConnectionAdding
Occurs when the connection is being added.
Declaration
public event EventHandler<GenericEventArgs<IConnection>> ConnectionAdding
  Event Type
| 
        System.EventHandler<GenericEventArgs<IConnection>>
         
  | 
    
ConnectionClicked
Occurs when connection is clicked.
Declaration
public event EventHandler<GenericEventArgs<IConnection>> ConnectionClicked
  Event Type
| 
        System.EventHandler<GenericEventArgs<IConnection>>
         
  | 
    
ConnectionDeserialized
Occurs when a connection has been deserialized.
Declaration
public event EventHandler<SerializationEventArgs<IConnection>> ConnectionDeserialized
  Event Type
| 
        System.EventHandler<SerializationEventArgs<IConnection>>
         
  | 
    
Remarks
This event allows you to recover additional, application specific data from the serialization.
See Also
ConnectionManipulationCompleted
Occurs when the connection manipulation has completed.
Declaration
public event EventHandler<ManipulationEventArgs> ConnectionManipulationCompleted
  Event Type
| 
        System.EventHandler<ManipulationEventArgs>
         
  | 
    
ConnectionManipulationStarted
Occurs before the connection manipulation has started.
Declaration
public event EventHandler<ManipulationEventArgs> ConnectionManipulationStarted
  Event Type
| 
        System.EventHandler<ManipulationEventArgs>
         
  | 
    
ConnectionSerialized
Occurs when a connection has been serialized.
Declaration
public event EventHandler<SerializationEventArgs<IConnection>> ConnectionSerialized
  Event Type
| 
        System.EventHandler<SerializationEventArgs<IConnection>>
         
  | 
    
Remarks
This event allows you to add additional, application specific data to the serialization.
See Also
ConnectorActivationChanged
Occurs after a connector activation or deactivation.
Declaration
public event EventHandler<ConnectorActivationChangedEventArgs> ConnectorActivationChanged
  Event Type
| 
        System.EventHandler<ConnectorActivationChangedEventArgs>
         
  | 
    
Deserialized
Occurs when the diagram has been deserialized.
Declaration
public event RoutedEventHandler Deserialized
  Event Type
| 
        RoutedEventHandler
         
  | 
    
DiagramLayoutComplete
Occurs when the diagram layout has completed.
Declaration
public event EventHandler<DiagramLayoutEventArgs> DiagramLayoutComplete
  Event Type
| 
        System.EventHandler<DiagramLayoutEventArgs>
         
  | 
    
Drag
Occurs when an item is dragged.
Declaration
public event EventHandler<DragRoutedEventArgs> Drag
  Event Type
| 
        System.EventHandler<DragRoutedEventArgs>
         
  | 
    
GraphSourceChanged
Occurs when the graph source has changed.
Declaration
public event EventHandler GraphSourceChanged
  Event Type
| 
        System.EventHandler
         
  | 
    
GraphSourceChanging
Occurs when the graph source begins changing.
Declaration
public event EventHandler GraphSourceChanging
  Event Type
| 
        System.EventHandler
         
  | 
    
GroupsChanged
Occurs when the count of groups changes in the diagram.
Declaration
public event EventHandler<DiagramItemsChangedEventArgs> GroupsChanged
  Event Type
| 
        System.EventHandler<DiagramItemsChangedEventArgs>
         
  | 
    
Remarks
This feature is not currently supported and is hidden from designers and IntelliSense.
ItemDataBound
Occurs after an Item is databound.
Declaration
public event DiagramItemDataBindingEventHandler ItemDataBound
  Event Type
| 
        DiagramItemDataBindingEventHandler
         
  | 
    
ItemsChanged
Occurs when count of the items change.
Declaration
public event EventHandler<DiagramItemsChangedEventArgs> ItemsChanged
  Event Type
| 
        System.EventHandler<DiagramItemsChangedEventArgs>
         
  | 
    
ItemsChanging
Occurs while the diagram items are changing.
Declaration
public event EventHandler<DiagramItemsChangingEventArgs> ItemsChanging
  Event Type
| 
        System.EventHandler<DiagramItemsChangingEventArgs>
         
  | 
    
MetadataDeserialized
Occurs when the diagram's metadata has been deserialized.
Declaration
public event EventHandler<SerializationInfoEventArgs> MetadataDeserialized
  Event Type
| 
        System.EventHandler<SerializationInfoEventArgs>
         
  | 
    
Remarks
The event allows you to deserialize the additional data added, if any, using the MetadataDeserialized event handler.
MetadataSerialized
Occurs when the diagram's metadata has been serialized.
Declaration
public event EventHandler<SerializationInfoEventArgs> MetadataSerialized
  Event Type
| 
        System.EventHandler<SerializationInfoEventArgs>
         
  | 
    
Remarks
This event allows you to add additional, application specific data to the serialization.
See Also
Pan
Occurs after the diagram is panned.
Declaration
public event EventHandler<PositionChangedRoutedEventArgs> Pan
  Event Type
| 
        System.EventHandler<PositionChangedRoutedEventArgs>
         
  | 
    
PositionChanged
Occurs when the position has changed.
Declaration
public event EventHandler<PositionChangedEventArgs> PositionChanged
  Event Type
| 
        System.EventHandler<PositionChangedEventArgs>
         
  | 
    
PreviewAdditionalContentActivated
Occurs when AdditionContent is about to be activated.
Declaration
public event EventHandler<AdditionalContentActivatedEventArgs> PreviewAdditionalContentActivated
  Event Type
| 
        System.EventHandler<AdditionalContentActivatedEventArgs>
         
  | 
    
PreviewDrag
Occurs before an item is dragged.
Declaration
public event EventHandler<DragRoutedEventArgs> PreviewDrag
  Event Type
| 
        System.EventHandler<DragRoutedEventArgs>
         
  | 
    
PreviewPan
Occurs before the diagram is panned.
Declaration
public event EventHandler<PositionChangedRoutedEventArgs> PreviewPan
  Event Type
| 
        System.EventHandler<PositionChangedRoutedEventArgs>
         
  | 
    
PreviewResize
Occurs before an item is resized.
Declaration
public event EventHandler<ResizeRoutedEventArgs> PreviewResize
  Event Type
| 
        System.EventHandler<ResizeRoutedEventArgs>
         
  | 
    
PreviewRotate
Occurs before an item is rotated.
Declaration
public event EventHandler<RoutedEventArgs> PreviewRotate
  Event Type
| 
        System.EventHandler<RoutedEventArgs>
         
  | 
    
PreviewSelectionChanged
Occurs when the selection of the diagram starts changing.
Declaration
public event EventHandler PreviewSelectionChanged
  Event Type
| 
        System.EventHandler
         
  | 
    
PreviewZoom
Occurs before the zoom has been changed.
Declaration
public event EventHandler<DiagramZoomEventArgs> PreviewZoom
  Event Type
| 
        System.EventHandler<DiagramZoomEventArgs>
         
  | 
    
Resize
Occurs when an item is resized.
Declaration
public event EventHandler<ResizingEventArgs> Resize
  Event Type
| 
        System.EventHandler<ResizingEventArgs>
         
  | 
    
Rotate
Occurs when an item is rotated.
Declaration
public event EventHandler<RotateRoutedEventArgs> Rotate
  Event Type
| 
        System.EventHandler<RotateRoutedEventArgs>
         
  | 
    
SelectionBoundsChanged
Declaration
public event EventHandler SelectionBoundsChanged
  Event Type
| 
        System.EventHandler
         
  | 
    
SelectionChanged
Occurs when the selection of the diagram changes.
Declaration
public event EventHandler SelectionChanged
  Event Type
| 
        System.EventHandler
         
  | 
    
Serialized
Occurs after the diagram has been serialized.
Declaration
public event RoutedEventHandler Serialized
  Event Type
| 
        RoutedEventHandler
         
  | 
    
ShapeClicked
Occurs when shape is clicked.
Declaration
public event EventHandler<ShapeRoutedEventArgs> ShapeClicked
  Event Type
| 
        System.EventHandler<ShapeRoutedEventArgs>
         
  | 
    
ShapeDeserialized
Occurs when a shape has been deserialized.
Declaration
public event EventHandler<SerializationEventArgs<IShape>> ShapeDeserialized
  Event Type
| 
        System.EventHandler<SerializationEventArgs<IShape>>
         
  | 
    
Remarks
The event allows you to deserialize the additional data added, if any, using the ShapeSerialized event handler.
ShapeDoubleClicked
Occurs when a shape has been double-clicked.
Declaration
public event EventHandler<ShapeRoutedEventArgs> ShapeDoubleClicked
  Event Type
| 
        System.EventHandler<ShapeRoutedEventArgs>
         
  | 
    
ShapeSerialized
Occurs when a shape has been serialized.
Declaration
public event EventHandler<SerializationEventArgs<IShape>> ShapeSerialized
  Event Type
| 
        System.EventHandler<SerializationEventArgs<IShape>>
         
  | 
    
Remarks
This event allows you to add additional, application specific data to the serialization.
See Also
ViewportChanged
Occurs when the diagram's viewport (visible area) has changed.
Declaration
public event EventHandler<PropertyEventArgs<Rect>> ViewportChanged
  Event Type
| 
        System.EventHandler<PropertyEventArgs<Rect>>
         
  | 
    
Remarks
This feature is not currently supported and is hidden from designers and IntelliSense.
VisualChildrenChanged
Occurs when [children changed].
Declaration
public event EventHandler VisualChildrenChanged
  Event Type
| 
        System.EventHandler
         
  | 
    
ZoomChanged
Occurs when the zoom has been changed.
Declaration
public event EventHandler<DiagramZoomEventArgs> ZoomChanged
  Event Type
| 
        System.EventHandler<DiagramZoomEventArgs>
         
  |