Skip to main content
A newer version of this page is available. .

RepositoryItemCheckEdit.AllowGrayed Property

Gets or sets a value specifying whether a check editor should support three check states rather than two.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v18.2.dll

Declaration

[DXCategory("Behavior")]
[DefaultValue(false)]
public bool AllowGrayed { get; set; }

Property Value

Type Default Description
Boolean **false**

true if the CheckEdit is able to display three check states; otherwise, false.

Remarks

Use the AllowGrayed property to determine whether a check editor supports two or three check states.

If this property is set to false, only two states - Unchecked and Checked are available. You can use the CheckEdit.Checked property to get or set the value of a two-state check edit control.

CheckEdit_AllowGrayed_TwoStates.gif

If the AllowGrayed property is true, a check editor can take one of the three check states: Unchecked, Checked and Indeterminate. In the indeterminate (also called “grayed”) state, the editor’s check box is displayed with a dimmed appearance to indicate that the option is unavailable. The value of a three-state check edit control can be get or set by using the CheckEdit.CheckState property.

CheckEdit_AllowGrayed_ThreeStates.gif

A check editor enables you to restore its indeterminate state after the AllowGrayed property is temporarily switched off and is then restored to true. To switch a check editor sequentially between the available check states, you can call the CheckEdit.Toggle method.

Assigning a new value for the AllowGrayed property raises the RepositoryItem.PropertiesChanged event.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AllowGrayed property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also