Type | Description | |||
Item as HITEM | A long expression that indicates the handle 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 | (By Reference) A long expression that specifies the new state of the cell ( 0- unchecked, 1 - checked, 2 - partial 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 PartialCheck property to enable partial check feature ( check boxes with three states: partial, checked and unchecked ). 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 Tree1_CellStateChanging(ByVal Item As EXTREELibCtl.HITEM, ByVal ColIndex As Long, NewState As Long) With Tree1 If (.ReadOnly) Then With .Items NewState = .CellState(Item, 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, AxEXTREELib._ITreeEvents_CellStateChangingEvent e) { } void OnCellStateChanging(long Item,long ColIndex,long FAR* NewState) { } void __fastcall CellStateChanging(TObject *Sender,Extreelib_tlb::HITEM Item,long ColIndex,long * NewState) { } procedure CellStateChanging(ASender: TObject; Item : HITEM;ColIndex : Integer;var NewState : Integer); begin end; procedure CellStateChanging(sender: System.Object; e: AxEXTREELib._ITreeEvents_CellStateChangingEvent); begin end; begin event CellStateChanging(long Item,long ColIndex,long NewState) end event CellStateChanging Private Sub CellStateChanging(ByVal sender As System.Object, ByVal e As AxEXTREELib._ITreeEvents_CellStateChangingEvent) Handles CellStateChanging End Sub Private Sub CellStateChanging(ByVal Item As EXTREELibCtl.HITEM,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(oTree,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 HITEM llItem Integer llColIndex Integer llNewState Forward Send OnComCellStateChanging llItem 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 (Item as OLE::Exontrol.Tree.1::HITEM,ColIndex as N,NewState as N) end function function nativeObject_CellStateChanging(Item,ColIndex,NewState) return |