event AfterExpandItem (Item as HITEM)
Fired after an item is expanded (collapsed).

TypeDescription
Item as HITEM A long expression that specifies the handle of the item that is expanded or collapsed.

The AfterExapndItem event notifies your application that an item is collapsed or expanded. Use the ExpandItem method to programmatically expand or collapse an item. The ExpandItem property also specifies whether an item is expand or collapsed. The ItemChild property retrieves the first child item. Use the BeforeExpandItem event to cancel expanding or collapsing items

Syntax for AfterExpandItem event, /NET version, on:

private void AfterExpandItem(object sender,int Item)
{
}

Private Sub AfterExpandItem(ByVal sender As System.Object,ByVal Item As Integer) Handles AfterExpandItem
End Sub

Syntax for AfterExpandItem event, /COM version, on:

private void AfterExpandItem(object sender, AxEXGRIDLib._IGridEvents_AfterExpandItemEvent e)
{
}

void OnAfterExpandItem(long Item)
{
}

void __fastcall AfterExpandItem(TObject *Sender,Exgridlib_tlb::HITEM Item)
{
}

procedure AfterExpandItem(ASender: TObject; Item : HITEM);
begin
end;

procedure AfterExpandItem(sender: System.Object; e: AxEXGRIDLib._IGridEvents_AfterExpandItemEvent);
begin
end;

begin event AfterExpandItem(long Item)
end event AfterExpandItem

Private Sub AfterExpandItem(ByVal sender As System.Object, ByVal e As AxEXGRIDLib._IGridEvents_AfterExpandItemEvent) Handles AfterExpandItem
End Sub

Private Sub AfterExpandItem(ByVal Item As EXGRIDLibCtl.HITEM)
End Sub

Private Sub AfterExpandItem(ByVal Item As Long)
End Sub

LPARAMETERS Item

PROCEDURE OnAfterExpandItem(oGrid,Item)
RETURN

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

<SCRIPT EVENT="AfterExpandItem(Item)" LANGUAGE="JScript">
</SCRIPT>

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

Procedure OnComAfterExpandItem HITEM llItem
	Forward Send OnComAfterExpandItem llItem
End_Procedure

METHOD OCX_AfterExpandItem(Item) CLASS MainDialog
RETURN NIL

void onEvent_AfterExpandItem(int _Item)
{
}

function AfterExpandItem as v (Item as OLE::Exontrol.Grid.1::HITEM)
end function

function nativeObject_AfterExpandItem(Item)
return

The following VB sample displays whether an item is expanded or collapsed:

Private Sub Grid1_AfterExpandItem(ByVal Item As EXGRIDLibCtl.HITEM)
    With Grid1.Items
        Debug.Print "Item is " & IIf(.ExpandItem(Item), "expanded", "collapsed") & "."
    End With
End Sub

The following C++ sample prints the item's state when it is expanded or collapsed:

#include "Items.h"
void OnAfterExpandItemGrid1(long Item) 
{
	if ( ::IsWindow( m_grid.m_hWnd ) )
	{
		CItems items = m_grid.GetItems();
		CString strFormat;
		strFormat.Format( "%s", items.GetExpandItem( Item ) ? "expanded" : "collapsed" );
		OutputDebugString( strFormat );
	}
}

The following C# sample prints the item's state when it is expanded or collapsed:

private void axGrid1_AfterExpandItem(object sender, AxEXGRIDLib._IGridEvents_AfterExpandItemEvent e)
{
	System.Diagnostics.Debug.WriteLine(axGrid1.Items.get_ExpandItem(e.item) ? "expanded" : "collapsed");
}

The following VB.NET sample prints the item's state when it is expanded or collapsed:

Private Sub AxGrid1_AddItem(ByVal sender As Object, ByVal e As AxEXGRIDLib._IGridEvents_AddItemEvent) Handles AxGrid1.AddItem
	AxGrid1.Items.ItemForeColor(e.item) = ToUInt32(Color.Blue)
End Sub

The following VFP sample prints the item's state when it is expanded or collapsed:

*** ActiveX Control Event ***
LPARAMETERS item

with thisform.Grid1.Items
	if ( .ExpandItem(item) )
		wait window "expanded" nowait
	else
		wait window "collapsed" nowait
	endif
endwith