Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenCheckBox<TValue>

    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
    IDisposable
    IRadzenFormComponent
    Inherited Members
    FormComponent<TValue>._value
    FormComponent<TValue>.SetParametersAsync(ParameterView)
    FormComponent<TValue>.Dispose()
    FormComponent<TValue>.GetValue()
    FormComponent<TValue>.OnContextMenu(MouseEventArgs)
    FormComponent<TValue>.GetClassList(string)
    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
    RadzenComponent.OnMouseEnter()
    RadzenComponent.OnMouseLeave()
    RadzenComponent.GetCssClass()
    RadzenComponent.GetId()
    RadzenComponent.Debounce(Func<Task>, int)
    RadzenComponent.OnInitialized()
    RadzenComponent.OnAfterRenderAsync(bool)
    RadzenComponent.RaiseContextMenu(MouseEventArgs)
    RadzenComponent.RaiseMouseEnter()
    RadzenComponent.AddContextMenu()
    RadzenComponent.RaiseMouseLeave()
    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(bool)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.DispatchExceptionAsync(Exception)
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Radzen.Blazor
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenCheckBox<TValue> : FormComponent<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IRadzenFormComponent
    Type Parameters
    Name Description
    TValue

    The 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()

    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()
    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" />

    Properties

    InputAttributes

    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
    [Parameter]
    public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, object>

    A dictionary of custom HTML attributes.

    ReadOnly

    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
    [Parameter]
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    bool

    true if the checkbox is read-only; otherwise, false. Default is false.

    TriState

    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
    [Parameter]
    public bool TriState { get; set; }
    Property Value
    Type Description
    bool

    true to enable tri-state mode; false for standard two-state mode. Default is false.

    Methods

    BuildRenderTree(RenderTreeBuilder)

    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
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder
    Overrides
    ComponentBase.BuildRenderTree(RenderTreeBuilder)

    GetComponentCssClass()

    Gets the component CSS class.

    Declaration
    protected override string GetComponentCssClass()
    Returns
    Type Description
    string
    Overrides
    RadzenComponent.GetComponentCssClass()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    IRadzenFormComponent

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT