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

DiagramBuilder

Defines the fluent API for configuring the Kendo Diagram for ASP.NET MVC.

Methods

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 that configures the 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 action that configures the connectiondefaults.

Connections(System.Action)

Defines the connections configuration.

Parameters

configurator - System.Action<DiagramConnectionFactory>

The action that configures the connections.

Editable(System.Boolean)

Defines how the diagram behaves when the user attempts to edit shape content, create new connections, edit connection labels and so on.

Parameters

enabled - System.Boolean

Enables or disables the editable option.

Editable(System.Action)

Defines how the diagram behaves when the user attempts to edit shape content, create new connections, edit connection labels and so on.

Parameters

configurator - System.Action<DiagramEditableSettingsBuilder>

The action that configures the editable.

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: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: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 action that configures the layout.

Pannable(System.Boolean)

Defines the pannable options.

Parameters

enabled - System.Boolean

Enables or disables the pannable option.

Pannable(System.Action)

Defines the pannable options.

Parameters

configurator - System.Action<DiagramPannableSettingsBuilder>

The action that configures the pannable.

Pdf(System.Action)

Configures the export settings for the saveAsPDF method.

Parameters

configurator - System.Action<DiagramPdfSettingsBuilder>

The action that configures the pdf.

Selectable(System.Boolean)

Defines the selectable options.

Parameters

enabled - System.Boolean

Enables or disables the selectable option.

Selectable(System.Action)

Defines the selectable options.

Parameters

configurator - System.Action<DiagramSelectableSettingsBuilder>

The action that configures the selectable.

ShapeDefaults(System.Action)

Defines the shape options.

Parameters

configurator - System.Action<DiagramShapeDefaultsSettingsBuilder>

The action that configures the shapedefaults.

Shapes(System.Action)

Defines the shape options.

Parameters

configurator - System.Action<DiagramShapeFactory>

The action that configures the shapes.

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. See the dataSource topic below for a concrete example.

Parameters

value - System.String

The value that configures the 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. See the dataSource topic below for a concrete example.

Parameters

value - System.String

The value that configures the template.

Theme(System.String)

Sets the theme of the diagram.

Parameters

theme - System.String

The Diagram theme.

Example


             @( Html.Kendo().Diagram()
                        .Name("Diagram")
                        .Theme("sass")
            )

Zoom(System.Double)

The zoom level in percentages.

Parameters

value - System.Double

The value that configures the zoom.

ZoomMax(System.Double)

The zoom max level in percentages.

Parameters

value - System.Double

The value that configures the zoommax.

ZoomMin(System.Double)

The zoom min level in percentages.

Parameters

value - System.Double

The value that configures the zoommin.

ZoomRate(System.Double)

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

Parameters

value - System.Double

The value that configures the zoomrate.

DataSource(System.Action)

Configure the HierarchicalDataSource of the component

Parameters

configurator - System.Action<DiagramDataSourceBuilder>

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

Example


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

ConnectionsDataSource(System.Action)

Configure the DataSource of the component

Parameters

configurator - System.Action<DiagramConnectionDataSourceBuilder>

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

Example


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

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
                            .Click("onClick")
                        )
            )

ToComponent()

Returns the internal view component.

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name of the component.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
               .Name("grid")
               .Columns(columns =>
               {
                   columns.Bound(p => p.OrderID).Filterable(false);
                   columns.Bound(p => p.Freight);  
               })
               .DataSource(dataSource => dataSource
                   .Ajax()
                   .PageSize(20)
                   .Read(read => read.Action("Orders_Read", "Grid"))
               )
            )

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean)

Parameters

deferred - System.Boolean

ModelMetadata(System.Web.Mvc.ModelMetadata)

Uses the Metadata of the Model.

Parameters

modelMetadata - System.Web.Mvc.ModelMetadata

The metadata set for the Model

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Parameters

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

Render()

Renders the component.

Example


            @(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
            @( Html.Kendo().Grid(Model)
                .Name("grid")
                .DetailTemplate(product => {
                    )
                       Product Details:
                       <div>Product Name: @( product.ProductName )</div>
                       <div>Units In Stock: @( product.UnitsInStock )</div>
                    @(
                })
                .Render();
            )

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?