RadzenCheckBox<TValue> Class

A checkbox input component that supports two-state (checked/unchecked) or tri-state (checked/unchecked/indeterminate) modes. RadzenCheckBox provides data binding, validation, and keyboard accessibility for boolean or nullable boolean values. In two-state mode, the value toggles between true and false. In tri-state mode (TriState = true), the value cycles through false → null → true → false. Supports keyboard interaction (Space/Enter to toggle) and integrates with Blazor EditContext for form validation.

Inheritance

Object

ComponentBase

RadzenComponent

FormComponent<TValue>

RadzenCheckBox<TValue>

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

Inherited Members

FormComponent<TValue>.SetParametersAsync

FormComponent<TValue>.Dispose

FormComponent<TValue>.GetValue

FormComponent<TValue>.OnContextMenu

FormComponent<TValue>.GetClassList

FormComponent<TValue>.FocusAsync

FormComponent<TValue>.Name

FormComponent<TValue>.TabIndex

FormComponent<TValue>.Placeholder

FormComponent<TValue>.Disabled

FormComponent<TValue>.EditContext

FormComponent<TValue>.Form

FormComponent<TValue>.ValueChanged

FormComponent<TValue>.HasValue

FormComponent<TValue>.IsBound

FormComponent<TValue>.Value

FormComponent<TValue>.Change

FormComponent<TValue>.FieldIdentifier

FormComponent<TValue>.ValueExpression

FormComponent<TValue>.FormFieldContext

FormComponent<TValue>.CurrentPlaceholder

FormComponent<TValue>._value

RadzenComponent.OnMouseEnter

RadzenComponent.OnMouseLeave

RadzenComponent.GetCssClass

RadzenComponent.GetId

RadzenComponent.Debounce

RadzenComponent.OnInitialized

RadzenComponent.OnAfterRenderAsync

RadzenComponent.RaiseContextMenu

RadzenComponent.RaiseMouseEnter

RadzenComponent.AddContextMenu

RadzenComponent.RaiseMouseLeave

RadzenComponent.OnBecameInvisible

RadzenComponent.Attributes

RadzenComponent.Element

RadzenComponent.MouseEnter

RadzenComponent.MouseLeave

RadzenComponent.ContextMenu

RadzenComponent.Culture

RadzenComponent.DefaultCulture

RadzenComponent.Style

RadzenComponent.Visible

RadzenComponent.UniqueID

RadzenComponent.JSRuntime

RadzenComponent.IsJSRuntimeAvailable

RadzenComponent.Reference

RadzenComponent.CurrentStyle

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenCheckBox<TValue> : FormComponent<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent

Type Parameters

Name Description
TValueThe type of the bound value. Typically bool for two-state or bool? for tri-state checkboxes.

Examples

Basic two-state checkbox:

<RadzenCheckBox @bind-Value=@isChecked TValue="bool" />

Tri-state checkbox with change handler:

<RadzenCheckBox @bind-Value=@nullableBool TValue="bool?" TriState="true" Change=@(args => Console.WriteLine($"Value: {args}")) />

Read-only checkbox for display purposes:

<RadzenCheckBox Value=@isEnabled TValue="bool" ReadOnly="true" />

Constructors

RadzenCheckBox<TValue>link

A checkbox input component that supports two-state (checked/unchecked) or tri-state (checked/unchecked/indeterminate) modes. RadzenCheckBox provides data binding, validation, and keyboard accessibility for boolean or nullable boolean values. In two-state mode, the value toggles between true and false. In tri-state mode (TriState = true), the value cycles through false → null → true → false. Supports keyboard interaction (Space/Enter to toggle) and integrates with Blazor EditContext for form validation.

Declaration
public RadzenCheckBox<TValue>()

Properties

InputAttributeslink

Gets or sets additional HTML attributes to be applied to the underlying input element. This allows passing custom attributes like data-* attributes, aria-* attributes, or other HTML attributes directly to the input.

Declaration
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
Property Value
Type Description
IReadOnlyDictionary<string, object>Gets or sets additional HTML attributes to be applied to the underlying input element. This allows passing custom attributes like data-* attributes, aria-* attributes, or other HTML attributes directly to the input.

ReadOnlylink

Gets or sets whether the checkbox is read-only and cannot be toggled by user interaction. When true, the checkbox displays its current state but prevents clicking or keyboard toggling. Useful for displaying checkbox state in view-only scenarios.

Declaration
public bool ReadOnly { get; set; }
Property Value
Type Description
boolGets or sets whether the checkbox is read-only and cannot be toggled by user interaction. When true, the checkbox displays its current state but prevents clicking or keyboard toggling. Useful for displaying checkbox state in view-only scenarios.

TriStatelink

Gets or sets whether the checkbox supports three states: checked (true), unchecked (false), and indeterminate (null). When enabled, clicking cycles through all three states. Use with nullable boolean (bool?) values.

Declaration
public bool TriState { get; set; }
Property Value
Type Description
boolGets or sets whether the checkbox supports three states: checked (true), unchecked (false), and indeterminate (null). When enabled, clicking cycles through all three states. Use with nullable boolean (bool?) values.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string
An error has occurred. This app may no longer respond until reloaded. Reload 🗙