windowsforms-devexpress-dot-xtraeditors-dot-controls-dot-checkedlistboxitem-32eb2d52.md
Gets or sets the item’s state.
Namespace : DevExpress.XtraEditors.Controls
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DefaultValue(CheckState.Unchecked)]
[DXCategory("Data")]
public virtual CheckState CheckState { get; set; }
<DefaultValue(CheckState.Unchecked)>
<DXCategory("Data")>
Public Overridable Property CheckState As CheckState
| Type | Default | Description |
|---|---|---|
| CheckState | Unchecked |
A CheckState enumeration member specifying the item’s state.
|
Use the CheckState property to specify the item’s state. Each item displayed by the CheckedListBoxControl can have three (checked, unchecked, indeterminate) states, as shown in the image below.
The BaseCheckedListBoxControl class provides a set of methods allowing you to either obtain or specify an item’s state. For example, use the BaseCheckedListBoxControl.GetItemCheckState method to identify the item’s current state. The BaseCheckedListBoxControl.SetItemCheckState method, in turn, enables you to set the specified item into one of the three states.
Note : to set an item to the indeterminate state at runtime, end-users must hold the CTRL key.
The following code snippets (auto-collected from DevExpress Examples) contain references to the CheckState 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.
CheckedComboBoxItem item = checkList.Items[e.Index].Value as CheckedComboBoxItem;
item.Checked = checkList.Items[e.Index].CheckState == CheckState.Checked;
}
winforms-grid-hide-vertical-lines-between-certain-columns/CS/E3647/Form1.cs#L73
checkedListBoxControl1.Items.Add(column, column.ToString(), CheckState.Unchecked, true);
checkedListBoxControl1.Items[0].CheckState = CheckState.Checked;
Dim item As CheckedComboBoxItem = TryCast(checkList.Items(e.Index).Value, CheckedComboBoxItem)
item.Checked = checkList.Items(e.Index).CheckState = CheckState.Checked
End Sub
winforms-grid-hide-vertical-lines-between-certain-columns/VB/E3647/Form1.vb#L71
Next column
checkedListBoxControl1.Items(0).CheckState = CheckState.Checked
See Also