Edit this page

Customize Appearance

This article describes how to customize the appearance of the RadDiagram,RadDrigramShape and RadDiagramConnection through a set of properties exposed by their API.

Customizing the RadDiagram Appearance

Controlling the Diagramming Surface Appearance

You can control the background settings of the diagramming surface through the following set of properties:

  • IsBackgroundSurfaceVisible - a Boolean property that determines whether the background surface of the RadDiagram should be displayed. When set to true both the background grid and the Preview Pages canvas are displayed. Its default value is true.
    Rad Diagram Styling Background Surface

  • Background - this property is of type Brush and it controls the fill of the RadDiagram background.
    Rad Diagram Styling Background

The settings and appearance of the RadDiagram background grid are controlled through the following set of attached properties:

You can access the BackgroundGrid attached properties through an alias pointing to the Telerik.Windows.Controls.Diagrams.Primitives namespace: xmlns:primitives="clr-namespace:Telerik.Windows.Controls.Diagrams.Primitives;assembly=Telerik.Windows.Controls.Diagrams" or by adding a using for the Telerik.Windows.Controls.Diagrams.Primitives namespace in your code-behind file.

  • BackgroundGrid.IsGridVisible - this is a Boolean property that controls the visibility of the background grid. Its default value is True.

    XAML

    <telerik:RadDiagram primitives:BackgroundGrid.IsGridVisible="True" />                     
    
  • BackgroundGrid.IsDynamic - this is a Boolean property that determines whether the background grid should be moved and resized accordingly to the RadDiagram viewport changes (panning and zooming). Its default value is True thus enabling the background grid to reflect the changes implemented by a pan and/or a zoom operation.

    XAML

    <telerik:RadDiagram primitives:BackgroundGrid.IsDynamic="True" />
    
  • BackgroundGrid.CellSize - this property is of type Size and it controls the size of the cells in the RadDiagram.GraphPaper surface. The default value of this property is a size of 20x20 units.

    XAML

    <telerik:RadDiagram primitives:BackgroundGrid.CellSize="40,40" />                     
    
  • BackgroundGrid.LineStroke - this property is of type Brush and it specifies how the cells outline is painted.

    XAML

    <telerik:RadDiagram primitives:BackgroundGrid.LineStroke="Red" />                                         
    

    Rad Diagram Styling Line Stroke

  • BackgroundGrid.LineStrokeDashArray - this property gets or sets a collection of Double values that indicate the pattern of dashes and gaps that is used to outline the cells in the RadDiagram GraphPaper.

  • BackgroundGrid.LineStrokeThickness - this property is of type double and it gets or sets the thickness of the RadDiagram background grid lines.

    XAML

    <telerik:RadDiagram primitives:BackgroundGrid.LineThickness="5" />                                        
    

    Rad Diagram Styling Line Thickness

If you need to customize the appearance and the settings of the RadDiagram PagesPreview canvas, you can examine the Pages Preview section in the Printing article.

DiagramAdorners

The RadDiagram exposes a set of properties that allow you to control which Diagramming adorners to be displayed:

  • IsInformationAdornerVisible - a Boolean property that controls the visibility of the InformationAdorner of the RadDiagram. The InformationAdorner displays information about the diagram's elements settings like current position and rotation angle. The default value of the IsInformationAdornerVisible property is true.
    Rad Diagram Styling Info Adorner

  • IsManipulationAdornerVisible - a Boolean property that controls the visibility of the ManipulationAdorner of the RadDiagram. The ManipulationAdorner visualizes the resizing and rotation thumbs of the RadDiagram elements. It also visualizes selections. The default value of the IsManipulationAdornerVisible property is true.
    Rad Diagram Styling Manipulation Adorner

  • IsConnectorsManipulationEnabled - a Boolean property that controls the visibility of the RadDiagram elements connectors. The default value of the property is true.
    Rad Diagram Styling Connectors Visibility

The RadDiagram also contains AlignmentAdorner. This adorner provides visual feedback about the alignment of the Diagramming elements.

The AlignmentAdorner definition is placed in the Telerik.Windows.Controls.Diagrams.Primitives namespace. This is why in order to control its settings, you need to add an alias to that namespace: >xmlns:primitives="clr-namespace:Telerik.Windows.Controls.Diagrams.Primitives;assembly=Telerik.Windows.Controls.Diagrams"
<telerik:RadDiagram primitives:AlignmentAdorner.VerticalLineStroke="Blue"/>

The RadDiagram allows you to control the following properties of the AlignmentAdorner:

  • AlignmentAdorner.HorizontalLineStroke - this property is of type Brush and it specifies how the horizontal alignment lines are painted.

  • AlignmentAdorner.HorizontalLineStrokeDashArray - this property gets or sets a collection of Double values that indicate the pattern of dashes and gaps that is used to outline the horizontal alignment lines.

  • AlignmentAdorner.HorizontalLineStrokeThickness - this property is of type double and it gets or sets the thickness of the horizontal alignment lines.

  • AlignmentAdorner.VerticalLineStroke - this property is of type Brush and it specifies how the vertical alignment lines are painted.

  • AlignmentAdorner.VerticalLineStrokeDashArray - this property is of type Brush and it specifies how the vertical alignment lines are painted.

  • AlignmentAdorner.VerticalLineStrokeThickness - this property gets or sets a collection of Double values that indicate the pattern of dashes and gaps that is used to outline the vertical alignment lines.

Customizing the RadDiagramShape Appearance

You can easily customize the visual appearance of the RadDiagramShape by using the following properties:

  • Background - gets or sets the brush that specifies the RadDiagramShape background color.

  • BorderBrush - gets or sets the brush that specifies the RadDiagramShape border color.

  • StrokeDashArray - gets or sets a collection of Double values that indicate the pattern of dashes and gaps that is used to outline the RadDiagramShape.

  • StrokeThickness - gets or sets the width of the RadDiagramShape outline.

You can also control what visual information should be displayed on a RadDiagramShape through the following set of properties:

  • IsConnectorsManipulationEnabled - a Boolean property that controls the visibility of the RadDiagramShape connectors. The default value of the property is true.

  • IsManipulationAdornerVisible - a Boolean property that controls the visibility of the ManipulationAdorner of the RadDiagramShape. The ManipulationAdorner visualizes the resizing and rotation thumbs of the shape, along with the selections it is part of. The default value of the IsManipulationAdornerVisible property is true.

  • IsResizingEnabled - a Boolean property that controls the resizing functionality of the shape along with the visibility of the resizing thumb. Its default value is True.

  • IsRotationEnabled- a Boolean property that controls the visibility of the rotation thumb as well as the rotation functionality of the shape. Its default value is True.

  • IsDraggingEnabled - a Boolean property that controls the dragging functionality of the shape, along with teh visibility of the dragging thumb. Its default value is True.

Customizing the RadDiagramConnection Appearance

You can easily customize the visual appearance of the RadDiagramConnection by using the following properties:

  • Stroke - gets or sets the brush that specifies how the RadDiagramConnection is painted.

  • StrokeDashArray - gets or sets a collection of Double values that indicate the pattern of dashes and gaps that is used to outline the RadDiagramConnection.

  • StrokeThickness - gets or sets the width of the RadDiagramConnection outline.

  • Background - gets or sets the brush that specifies the SourceCap and TargetCap inner background.