New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Definition

Constructors

C#
public Diagram(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
Parameters:viewContextViewContextinitializerIJavaScriptInitializerurlGeneratorIUrlGenerator

Fields

C#
public IUrlGenerator urlGenerator

Properties

Defines accessibility options for the diagram.

C#
public DiagramAccessibilitySettings Accessibility { get; set; }

If set to false the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.

C#
public bool? AutoBind { get; set; }

Defines the defaults of the connections. Whenever a connection is created, the specified connectionDefaults will be used and merged with the (optional) configuration passed through the connection creation method.

C#
public DiagramConnectionDefaultsSettings ConnectionDefaults { get; set; }

Defines the connections configuration.

C#
public List<DiagramConnection> Connections { get; set; }
C#
public DataSource ConnectionsDataSource { get; }
C#
public DataSource DataSource { get; }

Editable

DiagramEditableSettings<TShapeModel, TConnectionModel>

A set of settings to configure the Diagram behavior when the user attempts to: edit, delete or create shapes and connections.; drag shapes.; resize shapes. or rotate shapes..

C#
public DiagramEditableSettings<TShapeModel, TConnectionModel> Editable { get; set; }

The layout of a diagram consists in arranging the shapes (sometimes also the connections) in some fashion in order to achieve an aesthetically pleasing experience to the user. It aims at giving a more direct insight in the information contained within the diagram and its relational structure.On a technical level, layout consists of a multitude of algorithms and optimizations: analysis of the relational structure (loops, multi-edge occurrence...); connectedness of the diagram and the splitting into disconnected components; crossings of connections or bends and length of links. and various ad-hoc calculations which depend on the type of layout. The criteria on which an algorithm is based vary but the common denominator is: a clean separation of connected components (subgraphs); an orderly organization of the shapes in such a way that siblings are close to another, i.e. a tight packing of shapes which belong together (parent of child relationship) or a minimum of connection crossings. Kendo diagram includes three of the most used layout algorithms which should cover most of your layout needs - tree layout, force-directed layout and layered layout. Please, check the type property for more details regarding each type.

C#
public DiagramLayoutSettings Layout { get; set; }

Defines the keyboard navigation options for the diagram.

C#
public DiagramNavigatableSettings Navigatable { get; set; }

Defines the pannable options. Use this setting to disable Diagram pan or change the key that activates the pan behavior.

C#
public DiagramPannableSettings Pannable { get; set; }

Configures the export settings for the saveAsPDF method.

C#
public DiagramPdfSettings Pdf { get; set; }

Defines the Diagram selection options.By default, you can select shapes in the Diagram in one of two ways: Clicking a single shape to select it and deselect any previously selected shapes. or Holding the Ctrl key while clicking multiple shapes to select them and any other shapes between them.. Using the selectable configuration, you can enable single selection only, enable selection by drawing a rectangular area with the mouse around shapes in the canvas, or disable selection altogether.

C#
public DiagramSelectableSettings Selectable { get; set; }

Defines the default options that will be applied to all shapes in the Diagram.

C#
public DiagramShapeDefaultsSettings ShapeDefaults { get; set; }

Defines the shape options.

C#
public List<DiagramShape> Shapes { get; set; }

The tabIndex value to set on the diagram element.

C#
public double? TabIndex { get; set; }

The template which renders the content of the shape when bound to a dataSource. The names you can use in the template correspond to the properties used in the dataSource. For an example, refer to the dataSource topic below.

C#
public string Template { get; set; }

The handler for the Template

C#
public string TemplateHandler { get; set; }

The id for the Template

C#
public string TemplateId { get; set; }

The diagram theme. With versions prior to R1 2023 this can be either the respective LESS theme from the list below or "sass". When set to "sass" the diagram will read the variables from a Sass-based theme.Note: Since Q2 2024 release, the default value for the theme property is "sass" instead of "default". It is recommended to use "sass" with version Q2 2024 or later.The supported values are: * "sass" * "black" * "blueopal" * "bootstrap" * "bootstrap-v4" - works only with the Bootstrap-v4 Sass theme loaded in the page * "default" * "default-v2" - works only with the Default-v2 Sass theme loaded in the page * "fiori" * "flat" * "highcontrast" * "material" * "materialBlack" * "metro" * "metroblack" * "moonlight" * "nova" * "office365" * "silver" * "uniform"

C#
public string Theme { get; set; }

Defines the tooltip settings for the diagram.

C#
public DiagramTooltipSettings Tooltip { get; set; }

The default zoom level of the Diagram in percentages.

C#
public double? Zoom { get; set; }

The maximum zoom level in percentages. The user will not be allowed to zoom in past this level.

C#
public double? ZoomMax { get; set; }

The minimum zoom level in percentages. The user will not be allowed to zoom out past this level. You can see an example in zoomMax.

C#
public double? ZoomMin { get; set; }

The zoom step when using the mouse-wheel to zoom in or out.

C#
public double? ZoomRate { get; set; }

Methods

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

Overrides: WidgetBase.Serialize()

Writes the HTML.

C#
protected override void WriteHtml(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: WidgetBase.WriteHtml(HtmlTextWriter)

Writes the initialization script.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

The writer.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)