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

Defines the fluent API for configuring the Telerik UI Diagram for ASP.NET MVC client events.

Definition

Constructors

C#
public DiagramEventBuilder(IDictionary<string, object> events)
Parameters:eventsIDictionary<string, object>

Methods

Defines the handler of the Add client-side event. Fired when the user adds new shape or connection.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public DiagramEventBuilder Add(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Add event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.Add("onAdd"))
)

Defines the handler of the Cancel client-side event. Fired when the user clicks the "cancel" button in the popup window in case the item was added via a toolbar.

C#
public DiagramEventBuilder Cancel(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Cancel event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.Cancel("onCancel"))
)

Defines the handler of the Change client-side event. Fired when an item is added or removed to/from the diagram.

C#
public DiagramEventBuilder Change(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Change event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.Change("onChange"))
)

Defines the handler of the Click client-side event. Fired when the user clicks on a shape or a connection.

C#
public DiagramEventBuilder Click(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Click event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.Click("onClick"))
)

Defines the handler of the DataBound client-side event. Fired when the widget is bound to data from dataDource and connectionsDataSource.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public DiagramEventBuilder DataBound(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the DataBound event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.DataBound("onDataBound"))
)

Defines the handler of the Drag client-side event. Fired when dragging shapes or connection.

C#
public DiagramEventBuilder Drag(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Drag event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.Drag("onDrag"))
)

Defines the handler of the DragEnd client-side event. Fired after finishing dragging shapes or connection.

C#
public DiagramEventBuilder DragEnd(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the DragEnd event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.DragEnd("onDragEnd"))
)

Defines the handler of the DragStart client-side event. Fired before starting dragging shapes or connection.

C#
public DiagramEventBuilder DragStart(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the DragStart event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.DragStart("onDragStart"))
)

Defines the handler of the Edit client-side event. Fired when the user edits a shape or connection.

C#
public DiagramEventBuilder Edit(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Edit event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.Edit("onEdit"))
)

Defines the handler of the ItemBoundsChange client-side event. Fired when the location or size of a shape are changed.

C#
public DiagramEventBuilder ItemBoundsChange(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the ItemBoundsChange event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.ItemBoundsChange("onItemBoundsChange"))
)

Defines the handler of the ItemRotate client-side event. Fired when a shape is rotated.

C#
public DiagramEventBuilder ItemRotate(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the ItemRotate event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.ItemRotate("onItemRotate"))
)

Defines the handler of the MouseEnter client-side event. Fired when the mouse enters a shape or a connection.Will not fire for disabled items.

C#
public DiagramEventBuilder MouseEnter(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the MouseEnter event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.MouseEnter("onMouseEnter"))
)

Defines the handler of the MouseLeave client-side event. Fired when the mouse leaves a shape or a connection.Will not fire for disabled items.

C#
public DiagramEventBuilder MouseLeave(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the MouseLeave event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.MouseLeave("onMouseLeave"))
)

Defines the handler of the Pan client-side event. Fired when the user pans the diagram.

C#
public DiagramEventBuilder Pan(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Pan event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.Pan("onPan"))
)

Defines the handler of the Remove client-side event. Fired when the user removes a shape or connection.

C#
public DiagramEventBuilder Remove(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Remove event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.Remove("onRemove"))
)

Defines the handler of the Save client-side event. Fired when the user saves a shape or a connection.

C#
public DiagramEventBuilder Save(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Save event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.Save("onSave"))
)

Defines the handler of the Select client-side event. Fired when the user selects one or more items.

C#
public DiagramEventBuilder Select(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Select event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.Select("onSelect"))
)

Defines the handler of the ToolBarClick client-side event. Fired when the user clicks an item in the toolbar.

C#
public DiagramEventBuilder ToolBarClick(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the ToolBarClick event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.ToolBarClick("onToolBarClick"))
)

Defines the handler of the ZoomEnd client-side event. Fired when the user changes the diagram zoom level.

C#
public DiagramEventBuilder ZoomEnd(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the ZoomEnd event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.ZoomEnd("onZoomEnd"))
)

Defines the handler of the ZoomStart client-side event. Fired when the user starts changing the diagram zoom level.

C#
public DiagramEventBuilder ZoomStart(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the ZoomStart event.

Returns:

DiagramEventBuilder

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.Events(events =&gt; events.ZoomStart("onZoomStart"))
)