New to Telerik UI for ASP.NET Core? Download free 30-day trial

DiagramBuilder

Properties

WriteAction - Func

Methods

DataSource(System.Action)

Defines the hierarchical DataSource of the Diagram component.

Parameters

configurator - System.Action<DiagramDataSourceBuilder>

The action that configures the Kendo.Mvc.UI.Fluent.DiagramBuilder.DataSource(System.Action{Kendo.Mvc.UI.Diagram.Fluent.DiagramDataSourceBuilder{}}).

Example


             @(Html.Kendo().Diagram()
                .Name("diagram")
                .DataSource(dataSource => dataSource
                    .Read(read => read
                        .Action("_OrgChart", "Diagram")
                    )
                ))

ConnectionsDataSource(System.Action)

Defines the DataSource of the connections.

Parameters

configurator - System.Action<DiagramConnectionDataSourceBuilder>

The action that configures the Kendo.Mvc.UI.Fluent.DiagramBuilder.ConnectionsDataSource(System.Action{Kendo.Mvc.UI.Diagram.Fluent.DiagramConnectionDataSourceBuilder{}}).

Example


             @( Html.Kendo().Diagram()
                .Name("diagram")
                .ConnectionsDataSource(dataSource => dataSource
                    .Read(read => read
                        .Action("ConnectionsRead", "Diagram")
                    )
                )
             )

AutoBind(System.Boolean)

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.

Parameters

value - System.Boolean

The value for AutoBind

ConnectionDefaults(System.Action)

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.

Parameters

configurator - System.Action<DiagramConnectionDefaultsSettingsBuilder>

The configurator for the connectiondefaults setting.

Connections(System.Action)

Defines the connections configuration.

Parameters

configurator - System.Action<DiagramConnectionFactory>

The configurator for the connections setting.

Editable(System.Action)

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..

Parameters

configurator - System.Action<DiagramEditableSettingsBuilder>

The configurator for the editable setting.

Editable(System.Boolean)

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..

Parameters

enabled - System.Boolean

Enables or disables the editable option.

Layout(System.Action)

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.The generic way to apply a layout is by calling the layout() method on the diagram. The method has a single parameter options. It is an object, which can contain parameters which are specific to the layout as well as parameters customizing the global grid layout. Parameters which apply to other layout algorithms can be included but are overlooked if not applicable to the chose layout type. This means that you can define a set of parameters which cover all possible layout types and simply pass it in the method whatever the layout define in the first parameter.

Parameters

configurator - System.Action<DiagramLayoutSettingsBuilder>

The configurator for the layout setting.

Pannable(System.Action)

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

Parameters

configurator - System.Action<DiagramPannableSettingsBuilder>

The configurator for the pannable setting.

Pannable(System.Boolean)

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

Parameters

enabled - System.Boolean

Enables or disables the pannable option.

Pdf(System.Action)

Configures the export settings for the saveAsPDF method.

Parameters

configurator - System.Action<DiagramPdfSettingsBuilder>

The configurator for the pdf setting.

Selectable(System.Action)

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.

Parameters

configurator - System.Action<DiagramSelectableSettingsBuilder>

The configurator for the selectable setting.

Selectable(System.Boolean)

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.

Parameters

enabled - System.Boolean

Enables or disables the selectable option.

ShapeDefaults(System.Action)

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

Parameters

configurator - System.Action<DiagramShapeDefaultsSettingsBuilder>

The configurator for the shapedefaults setting.

Shapes(System.Action)

Defines the shape options.

Parameters

configurator - System.Action<DiagramShapeFactory>

The configurator for the shapes setting.

Template(System.String)

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.

Parameters

value - System.String

The value for Template

TemplateId(System.String)

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.

Parameters

templateId - System.String

The ID of the template element for Template

TemplateView(Microsoft.AspNetCore.Html.IHtmlContent)

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.

Parameters

templateView - Microsoft.AspNetCore.Html.IHtmlContent

The view that contains the template for Template

TemplateHandler(System.String)

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.

Parameters

templateHandler - System.String

The handler that returs the template for Template

Template(Kendo.Mvc.UI.TemplateBuilder)

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.

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the template.

Theme(System.String)

The diagram theme. This can be either a built-in theme or "sass". When set to "sass" the diagram will read the variables from a Sass-based theme.The supported values are: * "sass" - works only when a custom Sass theme is loaded in the page * "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"

Parameters

value - System.String

The value for Theme

Zoom(System.Double)

The default zoom level of the Diagram in percentages.

Parameters

value - System.Double

The value for Zoom

ZoomMax(System.Double)

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

Parameters

value - System.Double

The value for ZoomMax

ZoomMin(System.Double)

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.

Parameters

value - System.Double

The value for ZoomMin

ZoomRate(System.Double)

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

Parameters

value - System.Double

The value for ZoomRate

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<DiagramEventBuilder>

The client events action.

Example


            @(Html.Kendo().Diagram()
                  .Name("Diagram")
                  .Events(events => events
                      .Add("onAdd")
                  )
            )

ToComponent()

Returns the internal view component.

Expression(System.String)

Sets the name of the component.

Parameters

modelExpression - System.String

Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

Parameters

modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name.

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The HTML attributes.

ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Object

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

Render()

Renders the component in place.

ToHtmlString()

WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

Parameters

writer - System.IO.TextWriter
encoder - System.Text.Encodings.Web.HtmlEncoder

ToClientTemplate()

AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

Parameters

value - System.Boolean
In this article
Not finding the help you need?