Type | Description | |||
ItemIndex as Long | A long expression that indicates the index of the item where the cell's state is about to be changed. | |||
ColIndex as Long | A long expression that indicates the index of the column where the cell's state is changed, or a long expression that indicates the handle of the cell, if the Item parameter is 0. | |||
NewState as Long | A long expression that specifies the new state of the cell ( 0- unchecked, 1 - checked ) |
The control fires the CellStateChanging event just before cell's state is about to be changed. For instance, you can prevent changing the cell's state, by calling the NewState = Items.CellState(Item,ColIndex). 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 Def property to assign check-boxes / radio-buttons for all cells in the column. 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. We would not recommend changing the CellState property during the CellStateChanging event, to prevent recursive calls, instead you can change the NewState parameter which is passed by reference.
Once the user clicks a check-box, radio-button, the control fires the following events:
CellStateChanging event, where the NewState parameter indicates the new state of the cell's checkbox / radio-button.
CellStateChanged event notifies your application that the cell's check-box or radio-button has been changed. The CellState property determines the check-box/radio-button state of the cell.
Private Sub List1_CellStateChanging(ByVal ItemIndex As Long, ByVal ColIndex As Long, NewState As Long) With List1 If (.ReadOnly) Then With .Items NewState = .CellState(ItemIndex, ColIndex) End With End If End With End Sub
Syntax for CellStateChanging event, /NET version, on:
private void CellStateChanging(object sender,int Item,int ColIndex,ref int NewState) { } Private Sub CellStateChanging(ByVal sender As System.Object,ByVal Item As Integer,ByVal ColIndex As Integer,ByRef NewState As Integer) Handles CellStateChanging End Sub |
private void CellStateChanging(object sender, AxEXLISTLib._IListEvents_CellStateChangingEvent e) { } void OnCellStateChanging(long Item,long ColIndex,long FAR* NewState) { } void __fastcall CellStateChanging(TObject *Sender,long ItemIndex,long ColIndex,long * NewState) { } procedure CellStateChanging(ASender: TObject; ItemIndex : Integer;ColIndex : Integer;var NewState : Integer); begin end; procedure CellStateChanging(sender: System.Object; e: AxEXLISTLib._IListEvents_CellStateChangingEvent); begin end; begin event CellStateChanging(long ItemIndex,long ColIndex,long NewState) end event CellStateChanging Private Sub CellStateChanging(ByVal sender As System.Object, ByVal e As AxEXLISTLib._IListEvents_CellStateChangingEvent) Handles CellStateChanging End Sub Private Sub CellStateChanging(ByVal ItemIndex As Long,ByVal ColIndex As Long,NewState As Long) End Sub Private Sub CellStateChanging(ByVal Item As Long,ByVal ColIndex As Long,NewState As Long) End Sub LPARAMETERS Item,ColIndex,NewState PROCEDURE OnCellStateChanging(oList,Item,ColIndex,NewState) RETURN |
<SCRIPT EVENT="CellStateChanging(Item,ColIndex,NewState)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function CellStateChanging(Item,ColIndex,NewState) End Function </SCRIPT> Procedure OnComCellStateChanging Integer llItemIndex Integer llColIndex Integer llNewState Forward Send OnComCellStateChanging llItemIndex llColIndex llNewState End_Procedure METHOD OCX_CellStateChanging(Item,ColIndex,NewState) CLASS MainDialog RETURN NIL void onEvent_CellStateChanging(int _Item,int _ColIndex,COMVariant /*long*/ _NewState) { } function CellStateChanging as v (ItemIndex as N,ColIndex as N,NewState as N) end function function nativeObject_CellStateChanging(ItemIndex,ColIndex,NewState) return |