New to Telerik UI for BlazorStart a free 30-day trial

A segmented control component that allows users to select one option from a group of related options.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Type Parameters:

TItem

TValue

Syntax:

C#
public class TelerikSegmentedControl<TItem, TValue> : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikSegmentedControl<TItem, TValue>

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members BaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)...

Constructors

C#
public TelerikSegmentedControl()

Properties

The collection of items that will be rendered inside the SegmentedControl.

C#
[Parameter]
public IEnumerable<TItem> Data { get; set; }

Data field containing disabled identifier. Default: "Disabled".

C#
[Parameter]
public string DisabledField { get; set; }

Data field containing icon class identifier. Default: "IconClass".

C#
[Parameter]
public string IconClassField { get; set; }

Data field containing icon identifiers. Default: "Icon".

C#
[Parameter]
public string IconField { get; set; }

A template for rendering custom item content.

C#
[Parameter]
public RenderFragment<TItem>? ItemTemplate { get; set; }

Specifies the layout mode of the component. Compact sizes items based on content. Stretch stretches items to fill the available horizontal space.

C#
[Parameter]
public SegmentedControlLayoutMode LayoutMode { get; set; }

Sets the size of the control. Default value is Medium.

C#
[Parameter]
public string? Size { get; set; }

Data field containing text identifier. Default: "Text".

C#
[Parameter]
public string TextField { get; set; }

Data field containing title identifier. Default: "Title".

C#
[Parameter]
public string TitleField { get; set; }

Value

TValue

The currently selected item.

C#
[Parameter]
public TValue? Value { get; set; }

Event fired when an item is clicked and the selection changes.

C#
[Parameter]
public EventCallback<TValue?> ValueChanged { get; set; }

Data field containing value identifier. Default: "Value".

C#
[Parameter]
public string ValueField { get; set; }

Data field containing visible identifier. Default: "Visible".

C#
[Parameter]
public string VisibleField { get; set; }

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
public override void Dispose()

Overrides: BaseComponent.Dispose()

C#
protected Task InitJsComponentAsync()
Returns:

Task

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: BaseComponent.OnAfterRenderAsync(bool)