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.
FormComponent<TValue>.SetParametersAsync
FormComponent<TValue>.GetValue
FormComponent<TValue>.OnContextMenu
FormComponent<TValue>.GetClassList
FormComponent<TValue>.FocusAsync
FormComponent<TValue>.TabIndex
FormComponent<TValue>.Placeholder
FormComponent<TValue>.Disabled
FormComponent<TValue>.EditContext
FormComponent<TValue>.ValueChanged
FormComponent<TValue>.HasValue
FormComponent<TValue>.FieldIdentifier
FormComponent<TValue>.ValueExpression
FormComponent<TValue>.FormFieldContext
FormComponent<TValue>.CurrentPlaceholder
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
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
public class RadzenCheckBox<TValue> : FormComponent<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent| Name | Description |
|---|---|
| TValue | The type of the bound value. Typically bool for two-state or bool? for tri-state checkboxes. |
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" />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.
public RadzenCheckBox<TValue>()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.
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
| 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. |
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.
public bool ReadOnly { get; set; }
| Type | Description |
|---|---|
| bool | 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. |
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.
public bool TriState { get; set; }
| Type | Description |
|---|---|
| bool | 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. |