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

Defines the fluent API for configuring the Kendo UI Dialog

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class DialogBuilder : WidgetBuilderBase<Dialog, DialogBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<Dialog, DialogBuilder>DialogBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<Dialog, DialogBuilder>.ToComponent()WidgetBuilderBase<Dialog, DialogBuilder>.Expression(string)WidgetBuilderBase<Dialog, DialogBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<Dialog, DialogBuilder>.Name(string)WidgetBuilderBase<Dialog, DialogBuilder>.Deferred(bool)WidgetBuilderBase<Dialog, DialogBuilder>.HtmlAttributes(object)WidgetBuilderBase<Dialog, DialogBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<Dialog, DialogBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<Dialog, DialogBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<Dialog, DialogBuilder>.Render()WidgetBuilderBase<Dialog, DialogBuilder>.ToHtmlString()WidgetBuilderBase<Dialog, DialogBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<Dialog, DialogBuilder>.ToClientTemplate()WidgetBuilderBase<Dialog, DialogBuilder>.AsModule(bool)WidgetBuilderBase<Dialog, DialogBuilder>.ComponentWidgetBuilderBase<Dialog, DialogBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the DialogBuilder class.

C#
public DialogBuilder(Dialog component)
Parameters:componentDialog

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 DialogActionFactory for the actions setting.

Returns:

DialogBuilder

Returns the current instance of DialogBuilder .

Configures the animation effects of the panelbar.

C#
public DialogBuilder Animation(Action<PopupAnimationBuilder> animationAction)
Parameters:animationActionAction<PopupAnimationBuilder>

The action that configures the animation.

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

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

Configures the animation effects of the window.

C#
public DialogBuilder Animation(bool enable)
Parameters:enablebool

Whether the component animation is enabled.

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

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 for ButtonLayout

Returns:

DialogBuilder

Returns the current DialogBuilder instance.

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 for Closable

Returns:

DialogBuilder

Returns the current DialogBuilder instance.

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

Specifies width of the dialog.

C#
public DialogBuilder Content(Action action)
Parameters:actionAction

The value for Width

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

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

Specifies width of the dialog.

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

The value for Width

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Dialog()
.Name("dialog")
.Visible(true)
.Content(&lt;text&gt;Some Content&lt;/text&gt;)
)

The content of the dialog

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

The value for Content

Returns:

DialogBuilder

Returns the current DialogBuilder instance.

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

Configures the client-side events.

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

The client events action.

Returns:

DialogBuilder

Returns the current DialogBuilder instance.

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

Specifies height of the dialog.

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

The value for Height

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

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 for Height

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

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

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

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

The value for MaxHeight

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.MaxHeight(500)
)

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

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

The value for MaxHeight

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.MaxHeight("500px")
)

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

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

The value for MaxWidth

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.MaxWidth(800)
)

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

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

The value for MaxWidth

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.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 DialogMessagesSettingsBuilder for the messages setting.

Returns:

DialogBuilder

Returns the current instance of DialogBuilder .

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

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

The value for MinHeight

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.MinHeight(200)
)

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

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

The value for MinHeight

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.MinHeight("200px")
)

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

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

The value for MinWidth

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.MinWidth(400)
)

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

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

The value for MinWidth

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.MinWidth("300px")
)

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

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

The configurator for the modal setting.

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

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

A DialogBuilder instance for method chaining.

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 for Size

Returns:

DialogBuilder

Returns the current DialogBuilder instance.

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

Allows title to be shown / hidden

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

The value that configures the visibility of the title.

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

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

Sets title, which appears in the header of the dialog.

C#
public DialogBuilder Title(string title)
Parameters:titlestring

The value that configures the title of the dialog.

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

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

The value for Visible

Returns:

DialogBuilder

Returns the current DialogBuilder instance.

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 for Width

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.Width(700)
)

Specifies width of the dialog.

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

The value for Width

Returns:

DialogBuilder

A DialogBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Window()
.Name("window")
.Visible(true)
.Content("Window Content")
.MaxHeight("600px")
)