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

Events

The Telerik UI ColorPalette for ASP.NET MVC exposes a Change event that allows you to control the behavior of the UI component.

For a runnable example on the component Change event, refer to the demo on using the events of the ColorPalette.

Handling by Handler Name

The following example demonstrates how to subscribe to the Change event by a handler name.

    @(Html.Kendo().ColorPalette()
        .Name("colorpalette")
        .Events(e => e
            .Change("colorpalette_change")
        )
    )
    <script>
        function colorpalette_change(e) {
            // Handle the change event.
            var colorpalette = this;
            console.log(colorpalette.value());
        }
    </script>

Handling by Template Delegate

The following example demonstrates how to handle the Change event by a template delegate.

    @(Html.Kendo().ColorPalette()
          .Name("colorpalette")
          .Events(ev => ev
              .Change(@<text>
                function(e) {
                    // Handle the change event inline.
                    console.log(e.sender.value());
                }
                </text>)
          )
    )

Next Steps

See Also

In this article