property Items.SelectPos as Variant
Selects items by position.

TypeDescription
Variant A long expression that indicates the position of item being selected, if the SingleSel property is True, or a safe array that holds a collection of position of items being selected, if the SingleSel property is False.
Use the SelectPos property to select items by position. The SelectPos property selects an item giving its general position. Use the SelectItem property to select an item giving its handle. The ItemPosition property gives the relative position, or the position of the item in the child items collection. The Selection property selects/unselects items by index.

The SingleSel property specifies whether the control supports single or multiple-selection. Based on the SingleSel property the SelectPos value is:

The following VB sample selects the first item in the control:

Grid1.Items.SelectPos = 0

The following VB sample selects first two items:

Grid1.Items.SelectPos = Array(0, 1)

The following C++ sample selects the first item in the control:

m_tree.GetItems().SetSelectPos( COleVariant( long(0) ) );

The following VB.NET sample selects the first item in the control:

With AxGrid1.Items
    .SelectPos = 0
End With

The following C# sample selects the first item in the control:

axGrid1.Items.SelectPos = 0;

The following VFP sample selects the first item in the control:

with thisform.Grid1.Items
	.SelectPos = 0
endwith