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

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

Definition

Constructors

Initializes a new instance of the Dialog class.

C#
public DialogBuilder(Dialog component)
Parameters:componentDialog

The component.

Methods

A collection of objects containing text, action and primary attributes used to specify the dialog buttons.

C#
public DialogBuilder Actions(Action<DialogActionFactory> configurator)
Parameters:configuratorAction<DialogActionFactory>

The action that configures the actions.

Returns:

DialogBuilder

A collection of {Animation} objects, used to change default animations. A value of false will disable all animations in the widget. is not a valid configuration.

C#
public DialogBuilder Animation(Action<PopupAnimationBuilder> configurator)
Parameters:configuratorAction<PopupAnimationBuilder>

The action that configures the animation.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Animation(animation =&gt; animation.Open(open =&gt; open.Duration(700)))
)

A collection of {Animation} objects, used to change default animations. A value of false will disable all animations in the widget. is not a valid configuration.

C#
public DialogBuilder Animation(bool enabled)
Parameters:enabledbool

Enables or disables the animation option.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Animation(false)
)

Specifies the possible layout of the action buttons in the Dialog.Note: Stretched layout has no effect in browsers, like IE9, that do not support flexbox. Possible values are: normal or stretched.

C#
public DialogBuilder ButtonLayout(string value)
Parameters:valuestring

The value that configures the buttonlayout.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Actions(actions =&gt;
{
actions.Add().Text("Remind me later").Primary(true);
actions.Add().Text("Cancel");
})
.ButtonLayout("normal")
)

Specifies whether a close button should be rendered at the top corner of the dialog.

C#
public DialogBuilder Closable(bool value)
Parameters:valuebool

The value that configures the closable.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Closable(true)
)

Sets the HTML content which the window should display.

C#
public DialogBuilder Content(Action value)
Parameters:valueAction

The action which renders the content.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("dialog")
.Content(() =&gt;
{
&lt;strong&gt;Dialog content&lt;/strong&gt;
})
)

Sets the HTML content which the dialog should display

C#
public DialogBuilder Content(Func<object, object> value)
Parameters:valueFunc<object, object>

The Razor inline template

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("dialog")
.Dialog(@&lt;strong&gt; Hello World!&lt;/strong&gt;))

The content of the dialog

C#
public DialogBuilder Content(string value)
Parameters:valuestring

The value that configures the content.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
)

Configures the client-side events.

C#
public DialogBuilder Events(Action<DialogEventBuilder> configurator)
Parameters:configuratorAction<DialogEventBuilder>

The client events action.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Events(events =&gt; events
.Close("onClose")
)
)

Specifies height of the dialog.

C#
public DialogBuilder Height(double value)
Parameters:valuedouble

The value that configures the height.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Height(300)
)

Specifies height of the dialog.

C#
public DialogBuilder Height(string value)
Parameters:valuestring

The value that configures the height.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Height("300px")
)

The maximum height (in pixels) that may be achieved by resizing the window.

C#
public DialogBuilder MaxHeight(double value)
Parameters:valuedouble

The value that configures the maxheight.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.Resizable(r =&gt; r.MaxHeight(500))
)

The maximum height (in pixels) that may be achieved by resizing the window.

C#
public DialogBuilder MaxHeight(string value)
Parameters:valuestring

The value that configures the maxheight.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.Resizable(r =&gt; r.MaxHeight("500px"))
)

The maximum width (in pixels) that may be achieved by resizing the window.

C#
public DialogBuilder MaxWidth(double value)
Parameters:valuedouble

The value that configures the maxwidth.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.Resizable(r =&gt; r.MaxWidth(800))
)

The maximum width (in pixels) that may be achieved by resizing the window.

C#
public DialogBuilder MaxWidth(string value)
Parameters:valuestring

The value that configures the maxwidth.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.Resizable(r =&gt; r.MaxWidth("800px"))
)

Defines the text of the labels that are shown within the dialog. Used primarily for localization.

C#
public DialogBuilder Messages(Action<DialogMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<DialogMessagesSettingsBuilder>

The action that configures the messages.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Messages(m =&gt; m.Close("Close the dialog"))
)

The minimum height (in pixels) that may be achieved by resizing the window.

C#
public DialogBuilder MinHeight(double value)
Parameters:valuedouble

The value that configures the minheight.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.Resizable(r =&gt; r.MinHeight(300))
)

The minimum height (in pixels) that may be achieved by resizing the window.

C#
public DialogBuilder MinHeight(string value)
Parameters:valuestring

The value that configures the minheight.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.Resizable(r =&gt; r.MinHeight("300px"))
)

The minimum width (in pixels) that may be achieved by resizing the window.

C#
public DialogBuilder MinWidth(double value)
Parameters:valuedouble

The value that configures the minwidth.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.Resizable(r =&gt; r.MinWidth(400))
)

The minimum width (in pixels) that may be achieved by resizing the window.

C#
public DialogBuilder MinWidth(string value)
Parameters:valuestring

The value that configures the minwidth.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.Resizable(r =&gt; r.MinWidth("400px"))
)

Specifies whether the dialog should show a modal overlay over the page.

C#
public DialogBuilder Modal(Action<DialogModalSettingsBuilder> configurator)
Parameters:configuratorAction<DialogModalSettingsBuilder>

The action that configures additional modality settings.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Modal(modal =&gt; modal.PreventScroll(true))
)

Specifies whether the dialog should show a modal overlay over the page.

C#
public DialogBuilder Modal(bool enabled)
Parameters:enabledbool

Enables or disables the modal option.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Modal(true)
)

Set predefined size to the dialog. The width and height configuration options override the predefined size.Possible values are: auto; small; medium or large.

C#
public DialogBuilder Size(string value)
Parameters:valuestring

The value that configures the size.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Size("small")
)

Specifies whether the dialog title will be initially visible.

C#
public DialogBuilder Title(bool show)
Parameters:showbool

The value that configures the visibility of the title.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Title(false)
)

The text in the dialog title bar. If false, the dialog will be displayed without a title bar.

C#
public DialogBuilder Title(string value)
Parameters:valuestring

The value that configures the title of the dialog.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Title("Dialog title")
)

Specifies whether the dialog will be initially visible.

C#
public DialogBuilder Visible(bool value)
Parameters:valuebool

If true, the dialog will be initially visible.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
)

Specifies width of the dialog.

C#
public DialogBuilder Width(double value)
Parameters:valuedouble

The value that configures the width.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Width(500)
)

Specifies width of the dialog.

C#
public DialogBuilder Width(string value)
Parameters:valuestring

The value that configures the width.

Returns:

DialogBuilder

Example:
C#
@(Html.Kendo().Dialog()
.Name("Dialog")
.Visible(true)
.Content("Dialog content")
.Width("500px")
)