Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxCheckBox<T>.CheckType Property

Specifies the checkbox type.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(CheckType.Checkbox)]
[Parameter]
public CheckType CheckType { get; set; }

#Property Value

Type Default Description
CheckType Checkbox

A CheckType enumeration value.

Available values:

Name Description
Checkbox

A standard checkbox.

Switch

A toggle switch.

#Remarks

When the CheckType property is set to Checkbox, the <DxCheckBox> is displayed as a standard checkbox. Users can choose between checked, unchecked, and (optionally) indeterminate states.

Razor
<DxCheckBox @bind-Checked="@Value">@GetText()</DxCheckBox>
<DxCheckBox @bind-Checked="@Value">@GetText()</DxCheckBox>
<DxCheckBox @bind-Checked="@Value">@GetText()</DxCheckBox>


@code{
    bool? Value { get; set; }

    string GetText() {
        if (Value == true) return "Checked";
        if (Value == false) return "Unchecked";
        return "Indeterminate";
    }
}

CheckBox CheckType Checkbox

Set the CheckType property to Switch to display the <DxCheckBox> as a toggle switch. Users can select between the checked and unchecked states. The indeterminate state is not available in this mode.

CheckBox CheckType Switch

Razor
<DxCheckBox @bind-Checked="@Value" CheckType="CheckType.Switch">@GetText()</DxCheckBox>
<DxCheckBox @bind-Checked="@Value" CheckType="CheckType.Switch">@GetText()</DxCheckBox>

@code{
    bool Value { get; set; }

    string GetText() {
        if (Value) return "Checked";
        else return "Unchecked";
    }
}

Run Demo: CheckBox - Overview Run Demo: CheckBox - Switch Mode

See Also