Boolean Properties
- 2 minutes to read
In XAF, the following controls can display Boolean and Nullable Boolean properties:
- A CheckEdit control (default).
- A drop-down control that displays Boolean values as custom text strings. You can use the IModelCommonMemberViewItem.CaptionForTrue and IModelCommonMemberViewItem.CaptionForFalse properties to specify these strings in the Application Model.
- A drop-down control can display Boolean values as custom text strings accompanied by images. You can define these strings in the same manner as for a drop-down control. Use the IModelCommonMemberViewItem.ImageForTrue and IModelCommonMemberViewItem.ImageForFalse properties to assign images for the
true
andfalse
values. This option is available in WinForms and ASP.NET Web Forms applications only.
Refer to the following topics for more ORM-specific information on Boolean properties:
WinForms
Each WinForms Property Editor comes with a control that displays the corresponding property in a Detail View and a repository item that displays this property in a List Editor that supports in-place editing.
The following table shows available controls and repository items for BooleanPropertyEditor
:
Control | Repository item | Description |
---|---|---|
BooleanEdit (a CheckEdit descendant). | RepositoryItemBooleanEdit (a RepositoryItemCheckEdit descendant). | A CheckEdit control (default). |
BoolComboBoxEdit (an ImageComboBoxEdit descendant). | RepositoryItemBoolComboBoxEdit (a RepositoryItemImageComboBox descendant). | A drop-down control with custom text. An optional image is displayed next to the text when one of the following property pairs is specified: |
ASP.NET Web Forms
Each ASP.NET Web Forms Property Editor includes controls that display a property in a Detail View in View and Edit mode.
The following table shows available controls and repository items for ASPxBooleanPropertyEditor
:
View mode control | Edit mode controls | Description |
---|---|---|
The default control. | ||
| These controls are used when one of the following property pairs is specified: |
ASP.NET Core Blazor
In ASP.NET Core Blazor, the ViewItem.Control
property returns an IComponentContentHolder
descendant. This descendant has the ComponentModel
property, which returns an IComponentModel
descendant that wraps properties and events of a Blazor Editor.
The table below lists the corresponding descendants for BooleanPropertyEditor
:
IComponentContentHolder descendant | Component | Description |
---|---|---|
| The default control. | |
| This component is used when the following property pair is specified: CaptionForFalse and CaptionForTrue. |