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

Defines the fluent interface for configuring the Window component.

Definition

Constructors

C#
public WindowBuilder(Window component)
Parameters:componentWindow

Methods

Configures the window buttons.

C#
public WindowBuilder Actions(Action<WindowActionsBuilder> actionsBuilderAction)
Parameters:actionsBuilderActionAction<WindowActionsBuilder>

The buttons configuration action.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Actions(actions =&gt;
actions.Close()
)
)

Configures the animation effects of the panelbar.

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

The action that configures the animation.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Animation(animation =&gt; animation.Close(close =&gt; close.Duration(600)))
)

Enables or disables the animation effects of the window.

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

If true, enables the window animation

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Animation(false)
)

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

C#
public WindowBuilder AppendTo(string selector)
Parameters:selectorstring

A selector of the Window container

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.AppendTo(".container")
)

Sets whether the window automatically gains focus when opened.

C#
public WindowBuilder AutoFocus(bool value)
Parameters:valuebool

If true, the Window is focused automatically when opened.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.AutoFocus(true)
)

Sets the HTML content which the window should display.

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

The action which renders the content.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Content(() =&gt;
{

&lt;strong&gt;Window content&lt;/strong&gt;

})
)

Sets the HTML content which the window should display

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

The Razor inline template

Returns:

WindowBuilder

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

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

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

The action which renders the content.

Returns:

WindowBuilder

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

C#
public WindowBuilder ContentSettings(Action<WindowContentBuilder> action)
Parameters:actionAction<WindowContentBuilder>

The content settings action

Returns:

WindowBuilder

Sets whether the window can be moved.

C#
public WindowBuilder Draggable()
Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Draggable()
)

Configures the draggable settings.

C#
public WindowBuilder Draggable(Action<WindowDraggableSettingsBuilder> draggableSettings)
Parameters:draggableSettingsAction<WindowDraggableSettingsBuilder>

The configurator for the draggable setting.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Draggable(settings =&gt;
settings.Containment("#containment").DragHandle("#handle")
)
)

Sets whether the window can be moved.

C#
public WindowBuilder Draggable(bool value)
Parameters:valueboolReturns:

WindowBuilder

Configures the client-side events.

C#
public WindowBuilder Events(Action<WindowEventBuilder> clientEventsAction)
Parameters:clientEventsActionAction<WindowEventBuilder>

The client events action.

Returns:

WindowBuilder

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

Sets the height of the window.

C#
public WindowBuilder Height(int height)
Parameters:heightint

The height of the window.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Height(500)
)

Sets the height of the window.

C#
public WindowBuilder Height(string height)
Parameters:heightstring

The height of the window.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Height("500")
)

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

C#
public WindowBuilder Iframe(bool value)
Parameters:valuebool

If true, enables the iframe, otherwise disables it.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Iframe(true)
)

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

C#
public WindowBuilder LoadContentFrom(RouteValueDictionary routeValues)
Parameters:routeValuesRouteValueDictionary

The route values of the Action method.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.LoadContentFrom(MVC.Home.Index().GetRouteValueDictionary());
)

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

C#
public WindowBuilder LoadContentFrom(string actionName, string controllerName, object routeValues)
Parameters:actionNamestring

The action name.

controllerNamestring

The controller name.

routeValuesobject

Route values.

Returns:

WindowBuilder

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

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

C#
public WindowBuilder LoadContentFrom(string actionName, string controllerName, RouteValueDictionary routeValues)
Parameters:actionNamestring

The action name.

controllerNamestring

The controller name.

routeValuesRouteValueDictionary

Route values.

Returns:

WindowBuilder

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

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

C#
public WindowBuilder LoadContentFrom(string actionName, string controllerName)
Parameters:actionNamestring

The action name.

controllerNamestring

The controller name.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.LoadContentFrom("AjaxView_OpenSource", "Window")
)

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

C#
public WindowBuilder LoadContentFrom(string value)
Parameters:valuestring

The url.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.LoadContentFrom(Url.Action("AjaxView_OpenSource", "Window"))
)

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

C#
public WindowBuilder Modal(Action<WindowModalSettingsBuilder> configurator)
Parameters:configuratorAction<WindowModalSettingsBuilder>

The action that configures the modal.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Modal(m =&gt; m.PreventScroll(true))
)

Sets whether the window should be modal or not.

C#
public WindowBuilder Modal(bool modal)
Parameters:modalbool

If true, makes the window modal.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Modal(true)
)

Sets whether the window is pinned.

C#
public WindowBuilder Pinned()
Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Pinned()
)

Sets whether the window is pinned.

C#
public WindowBuilder Pinned(bool value)
Parameters:valuebool

If true, pins the window.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Pinned(true)
)

Configures the position of the window.

C#
public WindowBuilder Position(Action<WindowPositionSettingsBuilder> positionSettingsAction)
Parameters:positionSettingsActionAction<WindowPositionSettingsBuilder>

Position settings action.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Position(settings =&gt;
settings.Top(100).Left(100)
)
)

Enables windows resizing.

C#
public WindowBuilder Resizable()
Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Resizable()
)

Configures the resizing ability of the window.

C#
public WindowBuilder Resizable(Action<WindowResizingSettingsBuilder> resizingSettingsAction)
Parameters:resizingSettingsActionAction<WindowResizingSettingsBuilder>

Resizing settings action.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Resizable(settings =&gt;
settings.Enabled(true).MaxHeight(500).MaxWidth(500)
)
)

Sets whether the window should have scrollbars.

C#
public WindowBuilder Scrollable(bool scrollable)
Parameters:scrollablebool

If true, enables scrolling in the window.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Scrollable(true)
)

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

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

The value that configures the size.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Size("small")
)

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.

C#
public WindowBuilder Title(Action<WindowTitleSettingsBuilder> titleSettings)
Parameters:titleSettingsAction<WindowTitleSettingsBuilder>

The configurator for the title setting.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Title(t =&gt; t.Text("My Title"))
)

Allows title to be shown / hidden

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

If true, a title is shown.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Title(true)
)

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

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

The title.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Title("My title")
)

Sets whether the window should be rendered visible.

C#
public WindowBuilder Visible(bool visible)
Parameters:visiblebool

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

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Visible(true)
)

Sets the width of the window.

C#
public WindowBuilder Width(int width)
Parameters:widthint

The width of the window.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Width(600)
)

Sets the width of the window.

C#
public WindowBuilder Width(string width)
Parameters:widthstring

The width of the window.

Returns:

WindowBuilder

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Width("600")
)