Skip to main content

DxCheckBox<T>.CheckType Property

Specifies the checkbox type.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[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.

<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

<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