![]() | Type | Description | ||
| Options as Variant | By default, it is 0. If the Options is zero, the array contains the list of items as a table, else if the Options is not zero, and the number of columns is 1, the array includes the child items as they are displayed. In this case, the array may contains other arrays that specifies the child items. |
![]() | Return | Description | ||
| Variant | A safe array that holds the items in the control. If the control has a single column, the GetItems returns a single dimension array (object[]), else The safe array being returned has two dimensions (object[,]). The first dimension holds the collection of columns, and the second holds the cells. |
/NET Assembly:
The following C# sample converts the returned value to a object[] when the control contains a single column:
object[] Items = (object[])exg2antt1.GetItems()
or when the control contains multiple columns, the syntax is as follows:
object[,] Items = (object[,])exg2antt1.GetItems()
The following VB.NET sample converts the returned value to a Object() when the control contains a single column:
Dim Items As Object() = Exg2antt1.GetItems()
or when the control contains multiple columns, the syntax is as follows:
Dim Items As Object(,) = Exg2antt1.GetItems()
/COM version:
The following VB sample gets the items from a control and put them to the second one:
With G2antt2
.BeginUpdate
.Columns.Clear
Dim c As EXG2ANTTLibCtl.Column
For Each c In G2antt1.Columns
.Columns.Add c.Caption
Next
.PutItems G2antt1.GetItems
.EndUpdate
End With
The following C++ sample gets the items from a control an put to the second one:
#include "Items.h" #include "Columns.h" #include "Column.h" m_g2antt2.BeginUpdate(); CColumns columns = m_g2antt.GetColumns(), columns2 = m_g2antt2.GetColumns(); for ( long i = 0; i < columns.GetCount(); i++ ) columns2.Add( columns.GetItem( COleVariant( i ) ).GetCaption() ); COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR; COleVariant vtItems = m_g2antt.GetItems( vtMissing ); m_g2antt2.PutItems( &vtItems, vtMissing ); m_g2antt2.EndUpdate();
The following C# sample gets the items from a control and put them to a second one:
axG2antt2.BeginUpdate();
for (int i = 0; i < axG2antt1.Columns.Count; i++)
axG2antt2.Columns.Add(axG2antt1.Columns[i].Caption);
object vtItems = axG2antt1.GetItems("");
axG2antt2.PutItems(ref vtItems);
axG2antt2.EndUpdate();
The following VB.NET sample gets the items from a control and put them to a second one:
With AxG2antt2
.BeginUpdate()
Dim j As Integer
For j = 0 To AxG2antt1.Columns.Count - 1
.Columns.Add(AxG2antt1.Columns(j).Caption)
Next
Dim vtItems As Object
vtItems = AxG2antt1.GetItems("")
.PutItems(vtItems)
.EndUpdate()
End With
The following VFP sample gets the items from a control and put them to a second one:
local i
with thisform.G2antt2
.BeginUpdate()
for i = 0 to thisform.G2antt1.Columns.Count - 1
.Columns.Add( thisform.G2antt1.Columns(i).Caption )
next
local array vtItems[1]
vtItems = thisform.G2antt1.GetItems("")
.PutItems( @vtItems )
.EndUpdate()
endwith