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

TimeDurationPicker Events

You can subscribe to the Open, Close, and Change TimeDurationPicker events and further customize the functionality of the component.

For a complete example on basic TimeDurationPicker events, refer to the demo on using the events of the TimeDurationPicker.

Handling by Handler Name

The following example demonstrates how to subscribe to events by a handler name.

    @(Html.Kendo().TimeDurationPicker()
        .Name("timeDurationPicker")
        .Columns(c =>
        {
            c.Hours().Format("## hours ");
            c.Minutes().Format(" ## minutes");
        })
        .Events(e => e.Open("onOpen").Close("onClose").Change("onChange"))
    )
    <script>
        function timedurationpicker_open(e) {
            // Handle the open event.
        }

        function timedurationpicker_close(e) {
            // Handle the close event.
        }

        function timedurationpicker_change(e) {
            // Handle the change event.
        }
    </script>

Handling by Template Delegate

The following example demonstrates how to subscribe to events by a template delegate.

    @(Html.Kendo().TimeDurationPicker()
          .Name("timedurationpicker")
          .Events(e => e
              .Open(@<text>
                function(e) {
                    // Handle the open event inline.
                }
              </text>)
              .Close(@<text>
                function(e) {
                    // Handle the close event inline.
                }
              </text>)
              .Change(@<text>
                function(e) {
                    // Handle the change event inline.
                }
                </text>)
          )
    )

Next Steps

See Also

In this article