BaseCheckedListBoxControl.SetItemCheckState(Int32, CheckState) Method

Sets the check state of the item.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.1.dll


public virtual void SetItemCheckState(
    int index,
    CheckState value
Public Overridable Sub SetItemCheckState(
    index As Integer,
    value As CheckState


Name Type Description
index Int32

An integer value representing the zero-based index of the item.

value CheckState

A CheckState enumeration member specifying the new check state of the item.


Calling this method raises the BaseCheckedListBoxControl.ItemCheck event if the item's check state has been changed. Note that an exception is raised if the index parameter is negative or exceeds the last available index.

You can also use the BaseCheckedListBoxControl.SetItemChecked method to change the state of an item to be checked or unchecked. If you need to obtain the item's current state, use the BaseCheckedListBoxControl.GetItemCheckState or BaseCheckedListBoxControl.GetItemChecked methods.

If you need to change the item states of a databound BaseCheckedListBoxControl control during form loading, you need to call the BaseListBoxControl.ForceInitialize method beforehand.

See Also