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

DiagramShapeDefaultsSettingsConnectorBuilder

Methods

Name(System.String)

Defines the connector name. The name is referenced when specifying explicit FromConnector() and ToConnector() values in a connection.

Parameters

value - System.String

The value that configures the name.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Connectors(c =>
                {
                    c.Add().Name("Upstream");
                    c.Add().Name("SideLeft");
                })
               )
             )

Position(System.String)

Defines the name of the JavaScript function that positions the connector. The function accepts a shape as parameter and must return a "kendo.dataviz.diagram". As a result, a point that holds the connector position appears.

Parameters

value - System.String

The name of the JavaScript function that positions the connector.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Connectors(c =>
                {
                    c.Add().Name("Upstream").Position("getPosition");
                })
               )
             )
            <script>
                function getPosition(shape) {
                     return shape._transformPoint(shape.bounds().top());
                }
            </script>

Position(System.Func)

Defines the name of the JavaScript function that positions the connector. The function accepts a shape as parameter and must return a "kendo.dataviz.diagram". As a result, a point that holds the connector position appears.

Parameters

handler - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Connectors(c =>
                {
                    c.Add().Name("Upstream").Position(@<text>
                      function(shape) {
                        return shape._transformPoint(shape.bounds().top());
                      }
                      </text>);
                })
               )
             )

In this article
Not finding the help you need?