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

DiagramEditableSettingsToolBuilder

Methods

Name(System.String)

Defines the name of the tool. The built-in tools are "edit", "createShape", "createConnection", "undo", "redo", "rotateClockwise" and "rotateAnticlockwise".

Parameters

value - System.String

The value that configures the tool name.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("customTool")))
             )

Step(System.Double)

The step of the RotateClockwise and RotateAnticlockwise tools.

Parameters

value - System.Double

The value that configures the step.

Example


             @(Html.Kendo().Diagram()
                .Name("diagram")
                .Editable(editable => editable.Tools(tool =>
                {
                    tool.RotateClockwise().Step(2);
                    tool.RotateAnticlockwise().Step(2);
                 }))
             )

HtmlAttributes(System.Object)

Specifies the HTML attributes of the toolbar tool.

Parameters

value - System.Object

The value that configures the HTML attributes.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("customTool").HtmlAttributes(new { @class = "custom-btn"})))
             )

HtmlAttributes(System.Collections.Generic.IDictionary)

Specifies the HTML attributes of the toolbar tool.

Parameters

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

The value that configures the HTML attributes.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("customTool").HtmlAttributes(new Dictionary<string, object>() { ["class"] = "custom-btn" })))
             )

Buttons(System.Action)

Specifies the buttons of ButtonGroup.

Parameters

configurator - System.Action<DiagramEditableSettingsToolButtonFactory>

The action that configures the buttons.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(e => e.Tools(tt => tt.Custom().Name("customTool").Type("buttonGroup")
                  .Buttons(btn =>
                  {
                      btn.Add().Text("Item 1");
                      btn.Add().Text("Item 2");
                  })
               ))
             )

Click(System.String)

Specifies the "click" event handler of the toolbar button. The option is applicable only for tools of type button and splitButton

Parameters

value - System.String

The name of the JavaScript function that handles the "click" event.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("customUpdateBtn").Type("button").Text("Update").Click("onUpdateClick")))
             )

Enable(System.Boolean)

Specifies whether the toolbar button is initially enabled or disabled. The default value is "true".

Parameters

value - System.Boolean

The value that enables or disables the button.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("customBtn").Type("button").Text("Custom Button").Enable(false)))
             )

Group(System.String)

Assigns a group to the toolbar button. The option is applicable only for buttons with option Togglable(true).

Parameters

value - System.String

The value that configures the group of the button.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(e => e.Tools(tt =>
              {
                    tt.Custom().Type("button").Name("btn1").Text("Button 1").Togglable(true).Group("group1");
                    tt.Custom().Type("button").Name("btn2").Text("Button 2").Togglable(true).Group("group1");
                    tt.Custom().Type("button").Name("btn2").Text("Button 3").Togglable(true).Group("group1");
                })
              )
             )

Icon(System.String)

Sets an icon for the toolbar button. The icon must be one of the existing in the Kendo UI theme sprite.

Parameters

value - System.String

The value that configures the icon for the toolbar button.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("infoBtn").Type("button").Icon("info-circle")))
             )

Id(System.String)

Specifies the ID of the toolbar button.

Parameters

value - System.String

The value that configures the id.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("infoBtn").Type("button").Id("infoButton")))
             )

ImageUrl(System.String)

Sets an image with a specified URL to be rendered in the toolbar button.

Parameters

value - System.String

The value that configures the image URL.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").ImageUrl("/diagram/settings.png")))
             )

Specifies the menu buttons of SplitButton or DropDownButton in the Toolbar of the connection.

Parameters

configurator - System.Action<DiagramEditableSettingsToolMenuButtonFactory>

The action that configures the menu buttons.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(e => e.Tools(tt => tt.Custom().Name("splitBtn").Type("splitButton").Text("Split button")
                    .MenuButtons(mb =>
                    {
                        mb.Add().Id("1").Text("Item 1");
                        mb.Add().Id("2").Text("Item 2");
                    })
                ))
             )

Overflow(System.String)

Specifies how the button behaves when the toolbar is resized. The supported values are: "always", "never" or "auto" (default). If a toolbar item contains a template and the Overflow is set to "always", the template will never be rendered. If the item contains an OverflowTemplate() and the Overflow is set to "never", the specified overflow template will never be rendered.

Parameters

value - System.String

The value that configures the overflow.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").Text("Settings").Overflow("always")))
             )

OverflowTemplate(System.String)

Specifies what element will be added in the command overflow popup. The option is applicable only for toolbar items that have a template.

Parameters

value - System.String

The value that configures the overflow template.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom()
                .Name("settingsBtn")
                .Template("<div class='settings'>Settings</div>")
                .OverflowTemplate("<div class='overflow-settings'>Settings</div>")
              ))
             )

OverflowTemplateId(System.String)

Specifies what element will be added in the command overflow popup. The option is applicable only for toolbar items that have a template.

Parameters

value - System.String

The name of the Kendo UI external template.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom()
                .Name("settingsBtn")
                .Template("<div class='settings'>Settings</div>")
                .OverflowTemplateId("overflowTemplate")
              ))
             )
             <script id="overflowTemplate" type="text/x-kendo-template">
                <div class='overflow-settings'>Settings</div>
             </script>

OverflowTemplateView(System.Web.Mvc.MvcHtmlString)

Specifies what element will be added in the command overflow popup. The option is applicable only for toolbar items that have a template.

Parameters

value - System.Web.Mvc.MvcHtmlString

The Razor View that will be used for rendering the overflow template.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom()
                .Name("settingsBtn")
                .Template("<div class='settings'>Settings</div>")
                .OverflowTemplateView(Html.Partial("OverflowTemplateView"))
              ))
             )

OverflowTemplateHandler(System.String)

Specifies what element will be added in the command overflow popup. The option is applicable only for toolbar items that have a template.

Parameters

value - System.String

The JavaScript function that will return the overflow template content.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom()
                .Name("settingsBtn")
                .Template("<div class='settings'>Settings</div>")
                .OverflowTemplateHandler("getOverflowTemplate")
              ))
             )

Primary(System.Boolean)

Specifies whether the toolbar button is primary. The primary buttons have different styling.

Parameters

value - System.Boolean

The value that configures the primary.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").Text("Settings").Primary(true)))
             )

Selected(System.Boolean)

Specifies if the toolbar toggle button must be initially selected. The option is applicable only for buttons with Togglable(true).

Parameters

value - System.Boolean

The value that configures the selected option.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").Text("Settings").Togglable(true).Selected(true)))
             )

ShowIcon(System.String)

Specifies where the toolbar button icon will be displayed. The supported values are: "toolbar", "overflow", and "both" (default).

Parameters

value - System.String

The value that configures the visibility of the button icon.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("infoBtn").Type("button").Icon("info-circle").ShowIcon("toolbar")))
             )

ShowText(System.String)

Specifies where the toolbar button's text will be displayed. The supported values are: "toolbar", "overflow", and "both" (default).

Parameters

value - System.String

The value that configures the visibility of the button text.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").Text("Settings").ShowText("overflow")))
             )

SpriteCssClass(System.String)

Defines a CSS class (or multiple classes separated by spaces) that will be used for the button's icon.

Parameters

value - System.String

The value that configures the CSS class.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").Text("Settings").Icon("check").SpriteCssClass("tick-icon")))
             )

Template(System.String)

Specifies what element will be added in the ToolBar wrapper. The items with template do not have a type.

Parameters

value - System.String

The value that configures the template.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Template("<button style='color: red;'>Settings</button>")))
             )

TemplateId(System.String)

Specifies what element will be added in the ToolBar wrapper. The items with template do not have a type.

Parameters

value - System.String

The name of the Kendo UI external template.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").TemplateId("settingsTemplate")))
             )
             <script id="settingsTemplate" type="text/x-kendo-template">
                <button style='color: red;'>Settings</button>
             </script>

TemplateView(System.Web.Mvc.MvcHtmlString)

Specifies what element will be added in the ToolBar wrapper. The items with template do not have a type.

Parameters

value - System.Web.Mvc.MvcHtmlString

The Razor View that will be used for rendering the template.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").TemplateView(Html.Partial("ItemTemplateView"))))
             )

TemplateVHandler(System.String)

Specifies what element will be added in the ToolBar wrapper. The items with template do not have a type.

Parameters

value - System.String

The JavaScript function that will return the template content.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").TemplateHandler("getItemTemplate")))
             )

Text(System.String)

Sets the text of the button.

Parameters

value - System.String

The value that configures the text.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").Text("User settings")))
             )

Togglable(System.Boolean)

Specifies whether the toolbar button must be togglable. For example, the button has a selected and unselected state.

Parameters

value - System.Boolean

The value that enables or disables the togglable option.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").Text("User settings").Togglable(true)))
             )

Toggle(System.String)

Specifies the Toggle event handler of the toolbar button. The option is applicable only for commands with options Type("button") and Togglable(true).

Parameters

value - System.String

The name of the JavaScript function that handles the Toggle event.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").Text("User settings").Togglable(true).Toggle("onButtonToggle")))
             )
            <script>
                function onButtonToggle() {
                    console.log("toggle toolbar button");
                }
            </script>

Type(System.String)

Specifies the type of the toolbar command. The supported types are: "button", "splitButton", "dropDownButton", "buttonGroup", "separator", "spacer".

Parameters

value - System.String

The value that configures the type.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").Text("User settings")))
             )

Url(System.String)

Specifies the URL of the toolbar command to navigate to.

Parameters

value - System.String

The value that configures the URL.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .Editable(editable => editable.Tools(tt => tt.Custom().Name("settingsBtn").Type("button").Text("User settings").Url("URL value")))
             )

In this article
Not finding the help you need?