![]() | Type | Description | ||
| Node as Node | A Node object whose value is chaning. | |||
| NewValue as Variant | A Variant expression that indicates the newly node's value. |
The NewValue parameter indicates the newly node's value before assigning it to the Value property. You can use the Value property to get the old node's value.
The edit events are fired in the following order:
Edit event. Prevents editing nodes, before showing the node's editor.
EditOpen event. The edit operation started, the node's editor is shown. The Editing property gives the window's handle of the built-in editor being shown.
Change event. The Change event is fired only if the user types ENTER key, the user selects a new value from a predefined data list, or focus a new node.
EditClose event. The node's editor is hidden and closed.
If a node has an editor assigned the node's editor is applied to the:
The following VB sample assign a drop down editor to a cell and displays the newly value when user selects a new value from the drop down portion of the editor:
Private Sub Form_Load()
With XMLGrid1
.BeginUpdate
With .Editors
With .Add("DD", DropDownListType)
.AddButton "A", 1
.AddButton "B", 1, RightAlignment
.AddItem 1, "<b>1</b> One"
.AddItem 2, "<b>2</b> One"
.AddItem 3, "<b>3</b> One"
End With
End With
With .Nodes
With .Add("Select", 1)
.Editor = "DD"
End With
End With
.EndUpdate
End With
End Sub
Private Sub XMLGrid1_Change(ByVal Node As EXMLGRIDLibCtl.INode, NewValue As Variant)
Debug.Print "NewValue = " & NewValue
End Sub
The following C++ sample displays the value that user changes:
#include "Node.h"
void OnChangeXmlgrid1(LPDISPATCH Node, VARIANT FAR* NewValue)
{
CNode node( Node ); node.m_bAutoRelease = FALSE;
CString strNewValue = V2S( NewValue );
OutputDebugString( strNewValue );
}
where the V2S function converts a VARIANT expression to a string expression:
static CString V2S( const VARIANT* pvtValue )
{
COleVariant vtString;
vtString.ChangeType( VT_BSTR, (VARIANT*)pvtValue );
return V_BSTR( &vtString );
}
The following VB.NET sample displays the value that user changes:
Private Sub AxXMLGrid1_Change(ByVal sender As Object, ByVal e As AxEXMLGRIDLib._IXMLGridEvents_ChangeEvent) Handles AxXMLGrid1.Change
Debug.Write(e.newValue.ToString())
End Sub
The following C# sample displays the value that user changes:
private void axXMLGrid1_Change(object sender, AxEXMLGRIDLib._IXMLGridEvents_ChangeEvent e)
{
System.Diagnostics.Debug.Write(e.newValue.ToString());
}
The following VFP sample displays the value that user chages:
*** ActiveX Control Event *** LPARAMETERS node, newvalue wait window nowait newValue
Send comments on this topic. © 1999-2008 Exontrol Inc, Software. All rights reserved.