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

Defines the fluent API for configuring the Kendo UI Window

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class WindowBuilder : WidgetBuilderBase<Window, WindowBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<Window, WindowBuilder>WindowBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<Window, WindowBuilder>.ToComponent()WidgetBuilderBase<Window, WindowBuilder>.Expression(string)WidgetBuilderBase<Window, WindowBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<Window, WindowBuilder>.Name(string)WidgetBuilderBase<Window, WindowBuilder>.Deferred(bool)WidgetBuilderBase<Window, WindowBuilder>.HtmlAttributes(object)WidgetBuilderBase<Window, WindowBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<Window, WindowBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<Window, WindowBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<Window, WindowBuilder>.Render()WidgetBuilderBase<Window, WindowBuilder>.ToHtmlString()WidgetBuilderBase<Window, WindowBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<Window, WindowBuilder>.ToClientTemplate()WidgetBuilderBase<Window, WindowBuilder>.AsModule(bool)WidgetBuilderBase<Window, WindowBuilder>.ComponentWidgetBuilderBase<Window, WindowBuilder>.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 WindowBuilder class.

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

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

Configures the animation effects of the window.

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

Whether the component animation is enabled.

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

Returns the current WindowBuilder instance.

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

Determines whether the Window will be focused automatically when opened. The property also influences the focus behavior when an already opened Window is clicked.

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

The value for AutoFocus

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

Enables (true) or disables (false) the ability for users to move/drag the widget.

C#
public WindowBuilder Draggable()
Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Enables (true) or disables (false) the ability for users to move/drag the widget.

C#
public WindowBuilder Draggable(Action<WindowDraggableSettingsBuilder> configurator)
Parameters:configuratorAction<WindowDraggableSettingsBuilder>

The configurator for the draggable setting.

Returns:

WindowBuilder

Enables (true) or disables (false) the ability for users to move/drag the widget.

C#
public WindowBuilder Draggable(bool enabled)
Parameters:enabledbool

Enables or disables the draggable option.

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Configures the client-side events.

C#
public WindowBuilder Events(Action<WindowEventBuilder> configurator)
Parameters:configuratorAction<WindowEventBuilder>

The client events action.

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

Example:
C#
@(Html.Kendo().Window()
.Name("Window")
.Events(events =&gt; events
.Activate("onActivate")
)
)

Specifies the height of the Window.

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

The value for Height

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Specifies the height of the Window.

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

The value for Height

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Explicitly states whether a content iframe will be created. For more information, refer to the documentation on using iframes.

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

The value for Iframe

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

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

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

The value for MaxHeight

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

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

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

The value for MaxHeight

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

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

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

The value for MaxWidth

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

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

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

The value for MaxWidth

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

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

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

The value for MinHeight

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

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

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

The value for MinHeight

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

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

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

The value for MinWidth

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

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

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

The value for MinWidth

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

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

C#
public WindowBuilder Modal()
Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

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

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

The configurator for the modal setting.

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

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

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

Enables or disables the modal option.

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Specifies whether the Window will be pinned, that is, that it will not move together with the page content during scrolling.

C#
public WindowBuilder Pinned()
Returns:

WindowBuilder

Returns the current WindowBuilder instance.

Specifies whether the Window will be pinned, that is, that it will not move together with the page content during scrolling.

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

The value for Pinned

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

A collection of one or two members which define the initial top and/or left position of the Window or the position of the containment element on the page.

C#
public WindowBuilder Position(Action<WindowPositionSettingsBuilder> configurator)
Parameters:configuratorAction<WindowPositionSettingsBuilder>

The configurator for the position setting.

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Enables windows resizing.

C#
public WindowBuilder Resizable()
Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

Enables (true) or disables (false) the scrolling of the Window contents.

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

The value for Scrollable

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Sets a predefined size to the Window. The width and height configuration options override the predefined size.The supported values are: auto; small; medium or large.

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

The value for Size

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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> configurator)
Parameters:configuratorAction<WindowTitleSettingsBuilder>

The configurator for the title setting.

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Whether the window title will be visible

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Returns the current WindowBuilder instance.

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

Specifies whether the Window will be initially visible.

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

The value for Visible

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Specifies the width of the Window.

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

The value for Width

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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

Specifies the width of the Window.

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

The value for Width

Returns:

WindowBuilder

Returns the current WindowBuilder instance.

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