event CellStateChanged (ItemIndex as Long, ColIndex as Long)
Fired after cell's state has been changed.

TypeDescription
ItemIndex as Long A long value that indicates the index of the item where the cell's state being changed.
ColIndex as Long A long value that indicates the column's index.

A cell that contains a radio button or a check box button fires the CellStateChanged event when its state is changed. Use the CellState property to change the cell's state. Use the CellHasRadioButton or CellHasCheckBox property to enable radio or check box button into a cell. Use the CellImage property to display an icon in the cell. Use the CellImages property to display multiple icons in the same cell.  Use the CellChecked property to determine the handle of the cell that's checked in a radio group. Use the CellRadioGroup property to radio group cells.

Syntax for CellStateChanged event, /NET version, on:

private void CellStateChanged(object sender,int ItemIndex,int ColIndex)
{
}

Private Sub CellStateChanged(ByVal sender As System.Object,ByVal ItemIndex As Integer,ByVal ColIndex As Integer) Handles CellStateChanged
End Sub

Syntax for CellStateChanged event, /COM version, on:

private void CellStateChanged(object sender, AxEXLISTLib._IListEvents_CellStateChangedEvent e)
{
}

void OnCellStateChanged(long ItemIndex,long ColIndex)
{
}

void __fastcall CellStateChanged(TObject *Sender,long ItemIndex,long ColIndex)
{
}

procedure CellStateChanged(ASender: TObject; ItemIndex : Integer;ColIndex : Integer);
begin
end;

procedure CellStateChanged(sender: System.Object; e: AxEXLISTLib._IListEvents_CellStateChangedEvent);
begin
end;

begin event CellStateChanged(long ItemIndex,long ColIndex)
end event CellStateChanged

Private Sub CellStateChanged(ByVal sender As System.Object, ByVal e As AxEXLISTLib._IListEvents_CellStateChangedEvent) Handles CellStateChanged
End Sub

Private Sub CellStateChanged(ByVal ItemIndex As Long,ByVal ColIndex As Long)
End Sub

Private Sub CellStateChanged(ByVal ItemIndex As Long,ByVal ColIndex As Long)
End Sub

LPARAMETERS ItemIndex,ColIndex

PROCEDURE OnCellStateChanged(oList,ItemIndex,ColIndex)
RETURN

Syntax for CellStateChanged event, /COM version (others), on:

<SCRIPT EVENT="CellStateChanged(ItemIndex,ColIndex)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function CellStateChanged(ItemIndex,ColIndex)
End Function
</SCRIPT>

Procedure OnComCellStateChanged Integer llItemIndex Integer llColIndex
	Forward Send OnComCellStateChanged llItemIndex llColIndex
End_Procedure

METHOD OCX_CellStateChanged(ItemIndex,ColIndex) CLASS MainDialog
RETURN NIL

void onEvent_CellStateChanged(int _ItemIndex,int _ColIndex)
{
}

function CellStateChanged as v (ItemIndex as N,ColIndex as N)
end function

function nativeObject_CellStateChanged(ItemIndex,ColIndex)
return

The following VB sample displays the caption of the cell that's checked into a radio group:

Private Sub List1_CellStateChanged(ByVal Index As Long, ByVal ColIndex As Long)
    With List1.Items
        Dim i As Long, c As Long
        .CellChecked 1234, i, c
        Debug.Print .Caption(i, c)
    End With
End Sub

Use the CellRadioGroup property to group cells into the same radio group.

The following VB sample groups the cells in the second column:

Dim i As Long
With List1.Items
    For i = 0 To .Count - 1
        .CellHasRadioButton(i, 1) = True
        .CellRadioGroup(i, 1) = 1234
    Next
End With

The following VB sample prints the caption of the cell's whose state is changed:

Private Sub List1_CellStateChanged(ByVal ItemIndex As Long, ByVal ColIndex As Long)
    With List1.Items
        Debug.Print .Caption(Index, ColIndex)
    End With
End Sub

The following C++ sample prints the caption of the cell's whose state is changed:

void OnCellStateChangedList1(long ItemIndex, long ColIndex) 
{
	if ( IsWindow( m_list.m_hWnd ) )
	{
		CItems items = m_list.GetItems();
		CString strCaption = V2S( &items.GetCaption( ItemIndex, COleVariant( ColIndex ) ) );
		OutputDebugString( strCaption );
	}
}

The following VB.NET sample prints the caption of the cell's whose state is changed:

Private Sub AxList1_CellStateChanged(ByVal sender As Object, ByVal e As AxEXLISTLib._IListEvents_CellStateChangedEvent) Handles AxList1.CellStateChanged
    With AxList1.Items
        Debug.Write(.Caption(e.itemIndex, e.colIndex))
    End With
End Sub

The following C# sample prints the caption of the cell's whose state is changed:

private void axList1_CellStateChanged(object sender, AxEXLISTLib._IListEvents_CellStateChangedEvent e)
{
	System.Diagnostics.Debug.WriteLine(axList1.Items.get_Caption(e.itemIndex, e.colIndex).ToString());
}

The following VFP sample prints the caption of the cell's whose state is changed:

*** ActiveX Control Event ***
LPARAMETERS itemindex, colindex

with thisform.List1.Items
	wait window nowait .Caption(itemindex,colindex)
endwith