property Editor.ExpandItem(Value as Variant) as Boolean
Expandes or collapses an item in the editor's list.

TypeDescription
Value as Variant A long expression that indicates the value of the item being expanded, a string expression that indicates the caption of the item being expanded.
Boolean A boolean expression that indicates whether the item is expanded or collapsed.

By default, the items in a drop down editor are collapsed. Use the ExpandItem to expand a specified item. Use the ExpandAll method to expand all items in the editor. Use the InsertItem method to insert a child item to your built-in editor.  Use the AddItem method to add new predefined values. Use the AddButton method to add a button to the editor. Use the DropDownAutoWidth property on False, when inserting predefined values as child items.

The following screen show shows a simple hierarchy into a built-in DropDownList editor:

The following VB sample adds a simple hierarchy to a DropDownList built-in editor:

Dim h1 As HITEM
With Grid1
    .BeginUpdate
    .Images ("gBJJgBggAAwAAgACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjIgjIBAEijUlk8plUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDh+Dw1bwuJh0Sf8txeHyFXx+Ryk9wsnxbAzUpycYxWNiWMyujleXjOm0+gjKA1gA1iA0Wf0mz2WY1WwjWywuvz2N1GzyO11ON3mXxe6xfFzvAwXI1UY3mh5292PJ1vMw3T7Hbo3T73L7nhl3f5/i8034Xn9Xr9nt91Cio+lXyjsfkMjAEkk/69Hg97UpSeZ3pSeBnpScAHwO/iMmBBaMQalJAQc10JvylUJkAD8Dh+lJ8Q4k5/D+zjygAgI")
    .Images ("gBJJgBggAAwAAgACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjIgjIBAEijUlk8plUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwV/YGFAGFYGDxVbxGHw2NxuLyVKyGPy2JxsPiT/yedn+RjOVzGGzWlh2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zGj23r5H09+d/Hx/f29b0OU+LQNU/0CwNA8EQSm6Kh8lUGo6j6QpGACSJPCqbsNBSVuAk5+Mik54B+lJwAfEYDxNFCTmBE8VAGlJgRdFsXxijRwRojJ4RujB8xKk8OI0gIA==")
    .Columns.Add "Column 1"
    .ColumnAutoResize = True
    .HeaderVisible = False
    With .Items
        h1 = .InsertItem(, , "Child 1") ' Inserts a child itme
        .CellValueFormat(h1, 0) = exHTML
        .CellHasCheckBox(h1, 0) = True   ' Associates a check box to a cell
        .CellValue(h1, 0) = 3            ' Sets the cell's value
        .CellImage(h1, 0) = 1            ' Associates an image to a cell
        With .CellEditor(h1, 0)
            .EditType = DropDownListType
            .DropDownAutoWidth = False
            .AddItem 1, "CObject class", 1
            .AddItem 2, "CCmdTarget class", 2, 1
            .AddItem 3, "CWnd class", 3, 2
            .AddItem 6, "S y n c", 1, 1
            .AddItem 4, "Exceptions", 1
            .AddItem 7, "System Exceptions", 2, 4
            .AddItem 5, "File Services", 2
            .ExpandAll
        End With
    End With
    .EndUpdate
End With

The following VB samples adds a simple hierarchy to a PickEditType buil-in editor:

With Grid1.Items
    With .CellEditor(.FirstVisibleItem, 0)
        .EditType = EXGRIDLibCtl.PickEditType
        .AddItem 0, "Organization"
        .InsertItem 1, "UN", , 0
        .InsertItem 2, "ONU", , 0
        .ExpandItem(0) = True
    End With
End With 

The following C++ sample adds a simple hierarchy to a PickEditType built-in editor:

#include "Items.h"
#include "Editor.h"
COleVariant vtMissing; V_VT( &vtMissing) = VT_ERROR;
CItems items = m_grid.GetItems();
CEditor editor = items.GetCellEditor( COleVariant( items.GetFirstVisibleItem() ), COleVariant( long(0) ) );
editor.SetEditType( 14 /*PickEditType*/ );
editor.AddItem( 0, "Organization", vtMissing );
editor.InsertItem( 1, "UN", vtMissing, COleVariant( long(0) ) );
editor.InsertItem( 2, "ONU", vtMissing, COleVariant( long(0) ) );
editor.SetExpandItem( COleVariant(long(0)), TRUE);

The following VB.NET sample adds a simple hierarchy to a DropDownListType built-in editor:

With AxGrid1.Items
    With .CellEditor(.FirstVisibleItem, 0)
        .EditType = EXGRIDLib.EditTypeEnum.DropDownListType
        .AddItem(0, "Organization")
        .InsertItem(1, "UN", , 0)
        .InsertItem(2, "ONU", , 0)
        .ExpandItem(0) = True
    End With
End With

The following C# sample adds a simple hierarchy to a DropDownListType built-in editor:

EXGRIDLib.Items items = axGrid1.Items;
EXGRIDLib.Editor editor = items.get_CellEditor(items.FirstVisibleItem, 0);
editor.EditType = EXGRIDLib.EditTypeEnum.DropDownListType;
editor.AddItem(0, "Organization", null);
editor.InsertItem(1, "UN",null,  0);
editor.InsertItem(2, "ONU",null, 0);
editor.set_ExpandItem(0, true);

The following VFP sample adds a simple hierarchy to a DropDownType built-in editor:

with thisform.Grid1.Items
	With .CellEditor(.FirstVisibleItem, 0) 
		.EditType = 14 && PickEdiType
        .AddItem(0, "Organization")
        .InsertItem(1, "UN", , 0)
        .InsertItem(2, "ONU", , 0)
        .ExpandItem(0) = .t.
	EndWith
endwith