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

DialogBuilder

Methods

Actions(System.Action)

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

Parameters

configurator - System.Action<DialogActionFactory>

The configurator that sets the actions.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Actions(actions =>
                 {
                     actions.Add().Text("Remind me later").Primary(true);
                     actions.Add().Text("Cancel");
                 })
            )

ButtonLayout(System.String)

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.

Parameters

value - System.String

The value that configures the buttonlayout.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Actions(actions =>
                 {
                     actions.Add().Text("Remind me later").Primary(true);
                     actions.Add().Text("Cancel");
                 })
                 .ButtonLayout("normal")
            )

Closable(System.Boolean)

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

Parameters

value - System.Boolean

The value that configures the closable.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Closable(true)
            )

Messages(System.Action)

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

Parameters

configurator - System.Action<DialogMessagesSettingsBuilder>

The action that configures the messages.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Messages(m => m.Close("Close the dialog"))
            )

Modal(System.Boolean)

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

Parameters

enabled - System.Boolean

Enables or disables the modal option.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Modal(true)
            )

Modal(System.Action)

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

Parameters

configurator - System.Action<DialogModalSettingsBuilder>

The action that configures additional modality settings.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Modal(modal => modal.PreventScroll(true))
            )

Visible(System.Boolean)

Specifies whether the dialog will be initially visible.

Parameters

value - System.Boolean

If true, the dialog will be initially visible.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
            )

Size(System.String)

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

Parameters

value - System.String

The value that configures the size.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Size("small")
            )

Content(System.String)

The content of the dialog

Parameters

value - System.String

The value that configures the content.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
            )

Animation(System.Boolean)

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.

Parameters

enabled - System.Boolean

Enables or disables the animation option.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Animation(false)
            )

Animation(System.Action)

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.

Parameters

configurator - System.Action<PopupAnimationBuilder>

The action that configures the animation.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Animation(animation => animation.Open(open => open.Duration(700)))
            )

Title(System.String)

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

Parameters

value - System.String

The value that configures the title of the dialog.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Title("Dialog title")
            )

Title(System.Boolean)

Specifies whether the dialog title will be initially visible.

Parameters

show - System.Boolean

The value that configures the visibility of the title.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Title(false)
            )

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<DialogEventBuilder>

The client events action.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Events(events => events
                    .Close("onClose")
                 )
            )

Height(System.Double)

Specifies height of the dialog.

Parameters

value - System.Double

The value that configures the height.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Height(300)
            )

Height(System.String)

Specifies height of the dialog.

Parameters

value - System.String

The value that configures the height.

Example


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

MaxHeight(System.Double)

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

Parameters

value - System.Double

The value that configures the maxheight.

Example


             @(Html.Kendo().Window()
                .Name("window")
                .Visible(true)
                .Content("Window Content")
                .Resizable(r => r.MaxHeight(500))
            )

MaxHeight(System.String)

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

Parameters

value - System.String

The value that configures the maxheight.

Example


             @(Html.Kendo().Window()
                .Name("window")
                .Visible(true)
                .Content("Window Content")
                .Resizable(r => r.MaxHeight("500px"))
            )

MaxWidth(System.Double)

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

Parameters

value - System.Double

The value that configures the maxwidth.

Example


             @(Html.Kendo().Window()
                .Name("window")
                .Visible(true)
                .Content("Window Content")
                .Resizable(r => r.MaxWidth(800))
            )

MaxWidth(System.String)

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

Parameters

value - System.String

The value that configures the maxwidth.

Example


             @(Html.Kendo().Window()
                .Name("window")
                .Visible(true)
                .Content("Window Content")
                .Resizable(r => r.MaxWidth("800px"))
            )

MinHeight(System.Double)

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

Parameters

value - System.Double

The value that configures the minheight.

Example


             @(Html.Kendo().Window()
                .Name("window")
                .Visible(true)
                .Content("Window Content")
                .Resizable(r => r.MinHeight(300))
            )

MinHeight(System.String)

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

Parameters

value - System.String

The value that configures the minheight.

Example


             @(Html.Kendo().Window()
                .Name("window")
                .Visible(true)
                .Content("Window Content")
                .Resizable(r => r.MinHeight("300px"))
            )

MinWidth(System.Double)

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

Parameters

value - System.Double

The value that configures the minwidth.

Example


             @(Html.Kendo().Window()
                .Name("window")
                .Visible(true)
                .Content("Window Content")
                .Resizable(r => r.MinWidth(400))
            )

MinWidth(System.String)

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

Parameters

value - System.String

The value that configures the minwidth.

Example


             @(Html.Kendo().Window()
                .Name("window")
                .Visible(true)
                .Content("Window Content")
                .Resizable(r => r.MinWidth("400px"))
            )

Width(System.Double)

Specifies width of the dialog.

Parameters

value - System.Double

The value that configures the width.

Example


             @(Html.Kendo().Dialog()
                 .Name("Dialog")
                 .Visible(true)
                 .Content("Dialog content")
                 .Width(500)
            )

Width(System.String)

Specifies width of the dialog.

Parameters

value - System.String

The value that configures the width.

Example


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

ToComponent()

Returns the internal view component.

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name of the component.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
               .Name("grid")
               .Columns(columns =>
               {
                   columns.Bound(p => p.OrderID).Filterable(false);
                   columns.Bound(p => p.Freight);
               })
               .DataSource(dataSource => dataSource
                   .Ajax()
                   .PageSize(20)
                   .Read(read => read.Action("Orders_Read", "Grid"))
               )
            )

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

ModelMetadata(System.Web.Mvc.ModelMetadata)

Uses the Metadata of the Model.

Parameters

modelMetadata - System.Web.Mvc.ModelMetadata

The metadata set for the Model

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Parameters

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

AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

Parameters

value - System.Boolean

Render()

Renders the component.

Example


            @(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
            @( Html.Kendo().Grid(Model)
                .Name("grid")
                .DetailTemplate(product => {
                    )
                       Product Details:
                       <div>Product Name: @( product.ProductName )</div>
                       <div>Units In Stock: @( product.UnitsInStock )</div>
                    @(
                })
                .Render();
            )

ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Object

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

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

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?