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

Bind RadioGroup to an Enum


Product RadioGroup for Blazor


Is there a way to bind the data source for a Blazor UI RadioGroup to an enum?


To achieve this, prepare a list of items that correspond to the enum values that can be shown to the user. Here is an example:

<TelerikRadioGroup @bind-Value="@Value" Data="@Subscriptions"></TelerikRadioGroup>

@code {
    private Subscription Value { get; set; }

    public enum Subscription
        Day = 0,
        Week = 1,
        Month = 2,
        Year = 3

    public List<Subscription> Subscriptions
            var subscriptionsAsArray = (Subscription[])Enum.GetValues(typeof(Subscription));
            List<Subscription> subscriptions = new List<Subscription>(subscriptionsAsArray);

            return subscriptions;
In this article