Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BaseCheckedListBoxControl.ToggleItem(Int32) Method

Toggles the state of the item at the specified index.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public virtual void ToggleItem(
    int index
)

#Parameters

Name Type Description
index Int32

An zero-based integer value which represents the index of the item whose state should be toggled.

#Remarks

The ToggleItem method is used to toggle the states of items within the BaseCheckedListBoxControl control.

If the BaseCheckedListBoxControl.AllowGrayed property is set to false (the default behavior), the method toggles checked and unchecked states only. You can use the BaseCheckedListBoxControl.GetItemChecked and BaseCheckedListBoxControl.GetItemCheckState methods to get the current state of a specific item.

When the BaseCheckedListBoxControl.AllowGrayed property is set to true, successive calls to the ToggleItem method select the unchecked, checked and grayed states. In this case, an item’s current state can be obtained via the BaseCheckedListBoxControl.GetItemCheckState method.

The ToggleItem method is used internally. Usually there is no need to call it directly.

See Also