New to Telerik UI for Blazor? Download free 30-day trial

ColorGradient Events

This article describes the available events of the Telerik ColorGradient for Blazor.

FormatChanged

The FormatChanged event fires when the user clicks on the toggle button, which changes the input format. The event can help you persist the selected Format at a later stage.

When using this event, make sure to update the component Format programmatically in the event handler.

Handle the ColorGradient FormatChanged event

@* Handle the ColorGradient FormatChanged event *@

<TelerikColorGradient
    @bind-Value="@Value"
    Format="@Format"
    FormatChanged="@FormatChangedHandler" />

@code {
    string Value { get; set; }
    ColorFormat Format { get; set; }

    async Task FormatChangedHandler(ColorFormat newFormat)
    {
        Format = newFormat;
    }
}

ValueChanged

The ValueChanged event fires continuously while the user is dragging the component handles, or changing the textbox values.

When using this event, make sure to update the component Value programmatically in the event handler.

Handle the ColorGradient ValueChanged event

@* Handle the ColorGradient ValueChanged event *@

<TelerikColorGradient
    Value="@Value"
    ValueChanged="@ValueChangedHandler" />

@code {
    string Value { get; set; }

    async Task ValueChangedHandler(string newValue)
    {
        Value = newValue;
    }
}

See Also

In this article
Not finding the help you need? Improve this article