event SelectionChanged ()
Fires when the user changes the selection.

TypeDescription
Use the SelectionChanged event to notify your application that the user changes the selection. Use the SingleSel property to specify whether the control supports single or multiple selection. Use the FocusNode property to retrieve the focused node. Use the SelectCount property to get the number of selected nodes. Use the SelectedNode property to retrieve the selected node giving its index in the selected nodes collection. Use the Selected property to select a node. Use the SelForeColor, SelForeColorChild, SelBackColor, SelBackColorChild properties to customize the colors for selected nodes.

Syntax for SelectionChanged event, /NET version, on:

private void SelectionChanged(object sender)
{
}

Private Sub SelectionChanged(ByVal sender As System.Object) Handles SelectionChanged
End Sub

Syntax for SelectionChanged event, /COM version, on:

private void SelectionChanged(object sender, EventArgs e)
{
}

void OnSelectionChanged()
{
}

void __fastcall SelectionChanged(TObject *Sender)
{
}

procedure SelectionChanged(ASender: TObject; );
begin
end;

procedure SelectionChanged(sender: System.Object; e: System.EventArgs);
begin
end;

begin event SelectionChanged()
end event SelectionChanged

Private Sub SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SelectionChanged
End Sub

Private Sub SelectionChanged()
End Sub

Private Sub SelectionChanged()
End Sub

LPARAMETERS nop

PROCEDURE OnSelectionChanged(oXMLGrid)
RETURN

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

<SCRIPT EVENT="SelectionChanged()" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function SelectionChanged()
End Function
</SCRIPT>

Procedure OnComSelectionChanged 
	Forward Send OnComSelectionChanged 
End_Procedure

METHOD OCX_SelectionChanged() CLASS MainDialog
RETURN NIL

void onEvent_SelectionChanged()
{
}

function SelectionChanged as v ()
end function

function nativeObject_SelectionChanged()
return

The following VB sample displays the selected node(s), as soon as the user changes the selection:

Private Sub XMLGrid1_SelectionChanged()
    With XMLGrid1
        Dim i As Long
        For i = 0 To .SelectCount - 1
            Debug.Print .SelectedNode(i).Name
        Next
    End With
End Sub

The following C++ sample displays the selected node(s), as soon as the user changes the selection:

#include "Node.h"
void OnSelectionChangedXmlgrid1() 
{
	if ( IsWindow( m_xmlgrid.m_hWnd ) )
		for ( long i = 0; i < m_xmlgrid.GetSelectCount(); i++ )
		{
			CNode node = m_xmlgrid.GetSelectedNode( COleVariant( i ) );
			OutputDebugString( node.GetName() );
		}
}

The following VB.NET sample displays the selected node(s), as soon as the user changes the selection:

Private Sub AxXMLGrid1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxXMLGrid1.SelectionChanged
    With AxXMLGrid1
        Dim i As Long
        For i = 0 To .SelectCount - 1
            Debug.Write(.get_SelectedNode(i).Name())
        Next
    End With
End Sub

The following C# sample displays the selected node(s), as soon as the user changes the selection:

private void axXMLGrid1_SelectionChanged(object sender, EventArgs e)
{
	for (int i = 0; i < axXMLGrid1.SelectCount; i++)
	{
		EXMLGRIDLib.Node node = axXMLGrid1.get_SelectedNode(i);
		System.Diagnostics.Debug.Write(node.Name);
	}
}

The following VFP sample displays the selected node(s), as soon as the user changes the selection:

*** ActiveX Control Event ***

With thisform.XMLGrid1
    local i
    For i = 0 To .SelectCount - 1
        wait window nowait .SelectedNode(i).Name
    Next
EndWith