Class
TelerikSegmentedControl<TItem, TValue>

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:

cs-api-definition
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

TelerikSegmentedControl()

Declaration

cs-api-definition
public TelerikSegmentedControl()

Properties

Data

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

Declaration

cs-api-definition
[Parameter]
public IEnumerable<TItem> Data { get; set; }

Property Value

IEnumerable<TItem>

DisabledField

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

Declaration

cs-api-definition
[Parameter]
public string DisabledField { get; set; }

Property Value

string

IconClassField

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

Declaration

cs-api-definition
[Parameter]
public string IconClassField { get; set; }

Property Value

string

IconField

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

Declaration

cs-api-definition
[Parameter]
public string IconField { get; set; }

Property Value

string

ItemTemplate

A template for rendering custom item content.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<TItem>? ItemTemplate { get; set; }

Property Value

RenderFragment<TItem>

LayoutMode

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

Declaration

cs-api-definition
[Parameter]
public SegmentedControlLayoutMode LayoutMode { get; set; }

Property Value

SegmentedControlLayoutMode

Size

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

Declaration

cs-api-definition
[Parameter]
public string? Size { get; set; }

Property Value

string

TextField

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

Declaration

cs-api-definition
[Parameter]
public string TextField { get; set; }

Property Value

string

TitleField

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

Declaration

cs-api-definition
[Parameter]
public string TitleField { get; set; }

Property Value

string

Value

The currently selected item.

Declaration

cs-api-definition
[Parameter]
public TValue? Value { get; set; }

Property Value

TValue

ValueChanged

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

Declaration

cs-api-definition
[Parameter]
public EventCallback<TValue?> ValueChanged { get; set; }

Property Value

EventCallback<TValue>

ValueField

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

Declaration

cs-api-definition
[Parameter]
public string ValueField { get; set; }

Property Value

string

VisibleField

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

Declaration

cs-api-definition
[Parameter]
public string VisibleField { get; set; }

Property Value

string

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

Dispose()

Declaration

cs-api-definition
public override void Dispose()

Overrides BaseComponent.Dispose()

InitJsComponentAsync()

Declaration

cs-api-definition
protected Task InitJsComponentAsync()

Returns

Task

OnAfterRenderAsync(bool)

Declaration

cs-api-definition
protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

Overrides BaseComponent.OnAfterRenderAsync(bool)