Skip to content

Check Box

A check box lets the user turn a yes/no value on or off. It is bound to a true/false value of the view model.

When to use it

  • A single yes/no choice, such as Remember me or Is active.
  • A group of independent options. Place several check boxes in a group, each bound to its own value.

For one choice among several, use Radio Button or a Dropdown.

Properties

Property Description
Model Binding The bool value of the view model that the check box shows and sets.
Read Only The user cannot change it.
Does Not Make Form Dirty Changing the box does not mark the form as changed.
Has Label Container Whether the group the check box is in shows its label container.

Common properties such as Color, Size and the CSS class are described in Common Options.

Events

Event When it fires
On Change The user checks or unchecks the box.

Example

A Send me updates box bound to Model.WantsUpdates:

  1. Add a WantsUpdates property of type bool to the form's model.
  2. Drag a Check Box onto the form, set its binding to WantsUpdates and its caption to a resource such as Send me updates.
  3. Read the value in a controller action:
function void Save()
{
    if Model.WantsUpdates
    {
        Domain.Subscription.Subscribe(Model.Email);
    }
}

Tips

  • A check box bound to an attribute of a business object class saves with the record.
  • In a list, a column of type Checkbox shows a true/false attribute. See Data List.

In Studio

The check box (not its group) and its properties.

The Check Box and its properties