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

WindowBuilder

Defines the fluent interface for configuring the Window component.

Methods

Title(System.Action)

The text in the window title bar. If false, the window will be displayed without a title bar. Note that this will prevent the window from being dragged, and the window titlebar buttons will not be shown.

Parameters

titleSettings - System.Action<WindowTitleSettingsBuilder>

The configurator for the title setting.

Example


             @(Html.Kendo().Window()
                       .Name("Window")
                       .Title(t => t.Text("My Title")) 
            )

Title(System.Boolean)

Allows title to be shown / hidden

Parameters

show - System.Boolean

If true, a title is shown.

Example


             @(Html.Kendo().Window()
                       .Name("Window")
                       .Title(true) 
            )

Title(System.String)

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

Parameters

title - System.String

The title.

Example


             @(Html.Kendo().Window()
                       .Name("Window")
                       .Title("My title") 
            )

AppendTo(System.String)

Defines a selector for the element to which the Window will be appended. By default this is the page body.

Parameters

selector - System.String

A selector of the Window container

Example


             @(Html.Kendo().Window()
                       .Name("Window")
                       .AppendTo(".container") 
            )

ContentSettings(System.Action)

Configure how the window content is fetched, parsed, and rendered

Parameters

action - System.Action<WindowContentBuilder>

The content settings action

Content(System.Action)

Sets the HTML content which the window should display.

Parameters

value - System.Action

The action which renders the content.

Example


             @(Html.Kendo().Window()
                       .Name("Window")
                       .Content(() => 
                       { 

                             <strong>Window content</strong>

                       })
            )

Content(System.Func)

Sets the HTML content which the window should display

Parameters

value - System.Func<Object,Object>

The Razor inline template

Example


             @(Html.Kendo().Window()
                       .Name("Window")
                       .Content(@<strong> Hello World!</strong>))

Content(System.String)

Sets the HTML content which the item should display as a string.

Parameters

value - System.String

The action which renders the content.

LoadContentFrom(System.Web.Routing.RouteValueDictionary)

Sets the Url, which will be requested to return the content.

Parameters

routeValues - System.Web.Routing.RouteValueDictionary

The route values of the Action method.

Example


             @(Html.Kendo().Window()
                    .Name("Window")
                    .LoadContentFrom(MVC.Home.Index().GetRouteValueDictionary());
            )

LoadContentFrom(System.String,System.String)

Sets the Url, which will be requested to return the content.

Parameters

actionName - System.String

The action name.

controllerName - System.String

The controller name.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .LoadContentFrom("AjaxView_OpenSource", "Window")
            )

LoadContentFrom(System.String,System.String,System.Object)

Sets the Url, which will be requested to return the content.

Parameters

actionName - System.String

The action name.

controllerName - System.String

The controller name.

routeValues - System.Object

Route values.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .LoadContentFrom("AjaxView_OpenSource", "Window", new { id = 10})
            )

LoadContentFrom(System.String,System.String,System.Web.Routing.RouteValueDictionary)

Sets the Url, which will be requested to return the content.

Parameters

actionName - System.String

The action name.

controllerName - System.String

The controller name.

routeValues - System.Web.Routing.RouteValueDictionary

Route values.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .LoadContentFrom("AjaxView_OpenSource", "Window", new RouteValueDictionary { { "param1", "1" }, { "param2", "2" } })
            )

LoadContentFrom(System.String)

Sets the Url, which will be requested to return the content.

Parameters

value - System.String

The url.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .LoadContentFrom(Url.Action("AjaxView_OpenSource", "Window"))
            )

Events(System.Action)

Configures the client-side events.

Parameters

clientEventsAction - System.Action<WindowEventBuilder>

The client events action.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Events(events =>
                            events.Open("onOpen").Close("onClose")
                        )
            )

Resizable()

Enables windows resizing.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Resizable()
            )

Resizable(System.Action)

Configures the resizing ability of the window.

Parameters

resizingSettingsAction - System.Action<WindowResizingSettingsBuilder>

Resizing settings action.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Resizable(settings =>
                            settings.Enabled(true).MaxHeight(500).MaxWidth(500)
                        )
            )

Actions(System.Action)

Configures the window buttons.

Parameters

actionsBuilderAction - System.Action<WindowActionsBuilder>

The buttons configuration action.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Actions(actions =>
                            actions.Close()
                        )
            )

Width(System.Int32)

Sets the width of the window.

Parameters

width - System.Int32

The width of the window.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Width(600)
            )

Height(System.Int32)

Sets the height of the window.

Parameters

height - System.Int32

The height of the window.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Height(500)
            )

Width(System.String)

Sets the width of the window.

Parameters

width - System.String

The width of the window.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Width("600")
            )

Height(System.String)

Sets the height of the window.

Parameters

height - System.String

The height of the window.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Height("500")
            )

Position(System.Action)

Configures the position of the window.

Parameters

positionSettingsAction - System.Action<WindowPositionSettingsBuilder>

Position settings action.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Position(settings =>
                            settings.Top(100).Left(100)
                        )
            )

Visible(System.Boolean)

Sets whether the window should be rendered visible.

Parameters

visible - System.Boolean

If true, the window is initially visible, otherwise it is hidden.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Visible(true)
            )

Scrollable(System.Boolean)

Sets whether the window should have scrollbars.

Parameters

scrollable - System.Boolean

If true, enables scrolling in the window.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Scrollable(true)
            )

Animation(System.Boolean)

Enables or disables the animation effects of the window.

Parameters

enable - System.Boolean

If true, enables the window animation

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Animation(false)
            )

Animation(System.Action)

Configures the animation effects of the panelbar.

Parameters

animationAction - System.Action<PopupAnimationBuilder>

The action that configures the animation.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Animation(animation => animation.Close(close => close.Duration(600)))
            )

Modal(System.Boolean)

Sets whether the window should be modal or not.

Parameters

modal - System.Boolean

If true, makes the window modal.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Modal(true)
            )

Modal(System.Action)

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

Parameters

configurator - System.Action<WindowModalSettingsBuilder>

The action that configures the modal.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Modal(m => m.PreventScroll(true))
            )

Draggable(System.Action)

Configures the draggable settings.

Parameters

draggableSettings - System.Action<WindowDraggableSettingsBuilder>

The configurator for the draggable setting.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Draggable(settings =>
                            settings.Containment("#containment").DragHandle("#handle")
                        )
            )

Draggable()

Configures the draggable settings.

Example


             @(Html.Kendo().Window()
                        .Name("Window")
                        .Draggable(settings =>
                            settings.Containment("#containment").DragHandle("#handle")
                        )
            )

Draggable(System.Boolean)

Sets whether the window can be moved.

Parameters

value - System.Boolean

Pinned()

Sets whether the window is pinned.

Example


             @(Html.Kendo().Window()
                .Name("Window")
                .Pinned()       
            )

AutoFocus(System.Boolean)

Sets whether the window automatically gains focus when opened.

Parameters

value - System.Boolean

If true, the Window is focused automatically when opened.

Example


             @(Html.Kendo().Window()
                .Name("Window")
                .AutoFocus(true)        
            )

Pinned(System.Boolean)

Sets whether the window is pinned.

Parameters

value - System.Boolean

If true, pins the window.

Example


             @(Html.Kendo().Window()
                .Name("Window")
                .Pinned(true)       
            )

Iframe(System.Boolean)

Explicitly specifies whether the loaded window content will be rendered as an iframe or in-line

Parameters

value - System.Boolean

If true, enables the iframe, otherwise disables it.

Example


             @(Html.Kendo().Window()
                .Name("Window")
                .Iframe(true)       
            )

Size(System.String)

Set predefined size to the window. 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().Window()
                .Name("Window")
                .Size("small")      
            )

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 Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean)

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>

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();
            )

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?