Back to Devexpress

BaseCheckedListBoxControl.CheckedItems Property

windowsforms-devexpress-dot-xtraeditors-dot-basecheckedlistboxcontrol-fe15d570.md

latest4.9 KB
Original Source

BaseCheckedListBoxControl.CheckedItems Property

Gets the collection of checked item values.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
public BaseCheckedListBoxControl.CheckedItemCollection CheckedItems { get; }
vb
<Browsable(False)>
Public ReadOnly Property CheckedItems As BaseCheckedListBoxControl.CheckedItemCollection

Property Value

TypeDescription
DevExpress.XtraEditors.BaseCheckedListBoxControl.CheckedItemCollection

A CheckedItemCollection object representing the collection of checked item values.

|

Remarks

The CheckedItems property specifies a collection of the values of checked items. If the ListBox works in unbound mode, an item’s value is specified by the ListBoxItem.Value property. In bound mode, item values are retrieved from the field specified by the BaseListBoxControl.ValueMember property.

The CheckedItems collection is read-only, which means that you cannot add, delete or modify its elements to change an item’s check state.

If you only need to obtain indexes of checked items, use the BaseCheckedListBoxControl.CheckedIndices property.

In unbound mode, to change an item’s check state, use the item’s CheckedListBoxItem.CheckState property. Individual items can be accessed via the control’s BaseCheckedListBoxControl.Items property using index notation.

In bound mode, to access particular items, use the BaseListBoxControl.GetItem method. To get and set an item’s check state, use the BaseCheckedListBoxControl.GetItemChecked, BaseCheckedListBoxControl.GetItemCheckState, BaseCheckedListBoxControl.SetItemChecked and BaseCheckedListBoxControl.SetItemCheckState methods.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CheckedItems 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.

winforms-grid-hide-vertical-lines-between-certain-columns/CS/E3647/Form1.cs#L81

csharp
columnList = new List<GridColumn>();
foreach (CheckedListBoxItem item in checkedListBoxControl1.CheckedItems)
    columnList.Add(item.Value as GridColumn);

winforms-grid-hide-vertical-lines-between-certain-columns/VB/E3647/Form1.vb#L78

vb
columnList = New List(Of GridColumn)()
For Each item As CheckedListBoxItem In checkedListBoxControl1.CheckedItems
    columnList.Add(TryCast(item.Value, GridColumn))

See Also

CheckedIndices

CheckOnClick

Items

BaseCheckedListBoxControl Class

BaseCheckedListBoxControl Members

DevExpress.XtraEditors Namespace