Type | Description | |||
Item as Variant | A long expression that indicates the handle of the item where the cell is, or 0. If the Item parameter is 0, the ColIndex parameter must indicate the handle of the cell. | |||
ColIndex as Variant | A long expression that indicates the index of the column where a cell is divided, or a long expression that indicates the handle of the cell being divided, if the Item parameter is missing or it is zero. | |||
Index as Variant | A long expression that indicates the index of the inner being requested. If the Index parameter is missing or it is zero, the InnerCell property retrieves the master cell. | |||
Variant | A long expression that indicates the handle of the inner cell. |
The following VB sample specifies whether a cell contains inner cells ( the function checks whether a cell is splitted ):
Private Function isSplit(ByVal g As EXG2ANTTLibCtl.G2antt, ByVal h As EXG2ANTTLibCtl.HITEM, ByVal c As Long) As Boolean With g.Items isSplit = IIf(Not .InnerCell(h, c, 0) = .InnerCell(h, c, 1), True, False) End With End Function
The following VB sample gets the master cell:
Private Function getMaster(ByVal g As EXG2ANTTLibCtl.G2antt, ByVal h As EXG2ANTTLibCtl.HITEM, ByVal c As Long) As EXG2ANTTLibCtl.HCELL With g.Items Dim r As EXG2ANTTLibCtl.HCELL r = c If Not (h = 0) Then r = .ItemCell(h, c) End If While Not (.CellParent(, r) = 0) r = .CellParent(, r) Wend getMaster = r End With End Function
The following VB sample counts the inner cells:
Private Function getInnerCount(ByVal g As EXG2ANTTLibCtl.G2antt, ByVal h As EXG2ANTTLibCtl.HITEM, ByVal c As Long) As Long With g.Items Dim i As Long i = -1 Do i = i + 1 Loop While Not (.InnerCell(h, c, i) = .InnerCell(h, c, i + 1)) getInnerCount = i End With End Function
The following C++ sample specifies whether a cell contains inner cells ( the function checks whether a cell is splitted ):
long V2I( VARIANT* pvtValue ) { COleVariant vtResult; vtResult.ChangeType( VT_I4, pvtValue ); return V_I4( &vtResult ); } BOOL isSplit( CG2antt& g2antt, long h, long c ) { CItems items = g2antt.GetItems(); return V2I( &items.GetInnerCell( COleVariant( h ), COleVariant( c ), COleVariant( (long)0 ) ) ) != V2I( &items.GetInnerCell( COleVariant( h ), COleVariant( c ), COleVariant( (long)1 ) ) ); }
The following C++ sample gets the master cell:
long getMaster( CG2antt& g2antt, long h, long c ) { COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR; CItems items = g2antt.GetItems(); long r = c; if ( h != 0 ) r = items.GetItemCell( h, COleVariant( c ) ); while ( V2I( &items.GetCellParent( vtMissing, COleVariant( r ) ) ) != 0 ) r = V2I( &items.GetCellParent( vtMissing, COleVariant( r ) ) ); return r; }
The following C++ sample counts the inner cells:
long getInnerCount( CG2antt& g2antt, long h, long c ) { CItems items = g2antt.GetItems(); COleVariant vtItem( h ), vtColumn( c ); long i = -1; do { i++; } while ( V2I( &items.GetInnerCell( vtItem, vtColumn, COleVariant( i ) ) ) != V2I( &items.GetInnerCell( vtItem, vtColumn, COleVariant( (long)(i + 1) ) ) ) ); return i; }
The following VB.NET sample splits the first visible cell in two cells:
With AxG2antt1.Items Dim i As Object i = .SplitCell(.FirstVisibleItem, 0) .CellValue(Nothing, i) = "inner cell" End With
The following C# sample splits the first visible cell in two cells:
EXG2ANTTLib.Items items = axG2antt1.Items; object i = items.get_SplitCell(items.FirstVisibleItem, 0); items.set_CellValue(null, i, "inner cell");
The following VFP sample splits the first visible cell in two cells:
with thisform.G2antt1.Items local i i = .SplitCell(.FirstVisibleItem,0) local s, crlf crlf = chr(13) + chr(10) s = "Items" + crlf s = s + "{" + crlf s = s + "CellValue(," + str(i) + ") = " + chr(34) + "inner cell" + chr(34) + crlf s = s + "}" thisform.G2antt1.Template = s endwith