# WindowEventBuilder

## Methods

### Activate(System.String)

Defines the handler of the Activate client-side event. Triggered when a Window has finished its opening animation.

For more information see [Activate](https://docs.telerik.com/kendo-ui/api/ui/window/events/activate) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the Activate event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Activate("onActivate"))
            )
             
```

### Activate(System.Func)

Defines the handler of the Activate client-side event. Triggered when a Window has finished its opening animation.

For more information see [Activate](https://docs.telerik.com/kendo-ui/api/ui/window/events/activate) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Activate(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Close(System.String)

Defines the handler of the Close client-side event. Triggered when a Window is closed either by the user or through the close() method.

For more information see [Close](https://docs.telerik.com/kendo-ui/api/ui/window/events/close) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the Close event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

### Close(System.Func)

Defines the handler of the Close client-side event. Triggered when a Window is closed either by the user or through the close() method.

For more information see [Close](https://docs.telerik.com/kendo-ui/api/ui/window/events/close) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

### Deactivate(System.String)

Defines the handler of the Deactivate client-side event. Triggered when a Window has finished its closing animation.

For more information see [Deactivate](https://docs.telerik.com/kendo-ui/api/ui/window/events/deactivate) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the Deactivate event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Deactivate("onDeactivate"))
            )
             
```

### Deactivate(System.Func)

Defines the handler of the Deactivate client-side event. Triggered when a Window has finished its closing animation.

For more information see [Deactivate](https://docs.telerik.com/kendo-ui/api/ui/window/events/deactivate) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Deactivate(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### DragEnd(System.String)

Defines the handler of the DragEnd client-side event. Triggered when a Window has been moved by the user.

For more information see [DragEnd](https://docs.telerik.com/kendo-ui/api/ui/window/events/dragend) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the DragEnd event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.DragEnd("onDragEnd"))
            )
             
```

### DragEnd(System.Func)

Defines the handler of the DragEnd client-side event. Triggered when a Window has been moved by the user.

For more information see [DragEnd](https://docs.telerik.com/kendo-ui/api/ui/window/events/dragend) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.DragEnd(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### DragStart(System.String)

Defines the handler of the DragStart client-side event. Triggered when the user starts to move the Window.

For more information see [DragStart](https://docs.telerik.com/kendo-ui/api/ui/window/events/dragstart) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the DragStart event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.DragStart("onDragStart"))
            )
             
```

### DragStart(System.Func)

Defines the handler of the DragStart client-side event. Triggered when the user starts to move the Window.

For more information see [DragStart](https://docs.telerik.com/kendo-ui/api/ui/window/events/dragstart) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.DragStart(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Error(System.String)

Defines the handler of the Error client-side event. Triggered when an Ajax request for content fails.

For more information see [Error](https://docs.telerik.com/kendo-ui/api/ui/window/events/error) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the Error event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Error("onError"))
            )
             
```

### Error(System.Func)

Defines the handler of the Error client-side event. Triggered when an Ajax request for content fails.

For more information see [Error](https://docs.telerik.com/kendo-ui/api/ui/window/events/error) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Error(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Maximize(System.String)

Defines the handler of the Maximize client-side event. Triggered when the user maximizes the Window. Introduced in 2016.Q1.SP1.

For more information see [Maximize](https://docs.telerik.com/kendo-ui/api/ui/window/events/maximize) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the Maximize event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Maximize("onMaximize"))
            )
             
```

### Maximize(System.Func)

Defines the handler of the Maximize client-side event. Triggered when the user maximizes the Window. Introduced in 2016.Q1.SP1.

For more information see [Maximize](https://docs.telerik.com/kendo-ui/api/ui/window/events/maximize) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Maximize(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Minimize(System.String)

Defines the handler of the Minimize client-side event. Triggered when the user minimizes the Window. Introduced in 2016.Q1.SP1.

For more information see [Minimize](https://docs.telerik.com/kendo-ui/api/ui/window/events/minimize) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the Minimize event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Minimize("onMinimize"))
            )
             
```

### Minimize(System.Func)

Defines the handler of the Minimize client-side event. Triggered when the user minimizes the Window. Introduced in 2016.Q1.SP1.

For more information see [Minimize](https://docs.telerik.com/kendo-ui/api/ui/window/events/minimize) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Minimize(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Open(System.String)

Defines the handler of the Open client-side event. Triggered when a Window is opened, that is, when the open() method is called.

For more information see [Open](https://docs.telerik.com/kendo-ui/api/ui/window/events/open) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the Open event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

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

### Open(System.Func)

Defines the handler of the Open client-side event. Triggered when a Window is opened, that is, when the open() method is called.

For more information see [Open](https://docs.telerik.com/kendo-ui/api/ui/window/events/open) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Open(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Refresh(System.String)

Defines the handler of the Refresh client-side event. Triggered when the content of a Window has finished loading via Ajax, when the Window iframe has finished loading, or when the Refresh button has been clicked on a Window with static content.

For more information see [Refresh](https://docs.telerik.com/kendo-ui/api/ui/window/events/refresh) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the Refresh event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Refresh("onRefresh"))
            )
             
```

### Refresh(System.Func)

Defines the handler of the Refresh client-side event. Triggered when the content of a Window has finished loading via Ajax, when the Window iframe has finished loading, or when the Refresh button has been clicked on a Window with static content.

For more information see [Refresh](https://docs.telerik.com/kendo-ui/api/ui/window/events/refresh) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Refresh(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Resize(System.String)

Defines the handler of the Resize client-side event. Triggered when the user resizes the Window.

For more information see [Resize](https://docs.telerik.com/kendo-ui/api/ui/window/events/resize) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the Resize event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Resize("onResize"))
            )
             
```

### Resize(System.Func)

Defines the handler of the Resize client-side event. Triggered when the user resizes the Window.

For more information see [Resize](https://docs.telerik.com/kendo-ui/api/ui/window/events/resize) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Resize(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Restore(System.String)

Defines the handler of the Restore client-side event. Triggered when the Window is restored to its previous state(maximized or minimized) by pressing the restore button, or when the restore() method is called.

For more information see [Restore](https://docs.telerik.com/kendo-ui/api/ui/window/events/restore) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the Restore event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Restore("onRestore"))
            )
             
```

### Restore(System.Func)

Defines the handler of the Restore client-side event. Triggered when the Window is restored to its previous state(maximized or minimized) by pressing the restore button, or when the restore() method is called.

For more information see [Restore](https://docs.telerik.com/kendo-ui/api/ui/window/events/restore) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

#### Example

```
 
             @( Html.Kendo().Window()
                        .Name("Window")
                        .Events(events => events.Restore(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### KendoKeydown(System.String)

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the Window is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

For more information see [KendoKeydown](https://docs.telerik.com/kendo-ui/api/ui/window/events/kendokeydown) event.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will handle the KendoKeydown event.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .

### KendoKeydown(System.Func)

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the Window is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

For more information see [KendoKeydown](https://docs.telerik.com/kendo-ui/api/ui/window/events/kendokeydown) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [WindowEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/windoweventbuilder) .
