Type | Description | |||
Item as Variant | A long expression that indicates the handle of the item where a cell is being divided, 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. | |||
Variant | A long expression that indicates the handle of the cell being created. |
( "Merge" means multiple cells in a single cell, "Split" means multiple cells inside a single cell )
The following VB sample splits a single cell in two cells ( Before running the following sample, please make sure that your control contains columns, and at least an item ):
With Grid1.Items Dim h As HITEM, f As HCELL h = .FirstVisibleItem f = .SplitCell(h, 0) .CellValue(, f) = "inner cell" End With
The following VB sample splits a cell in three cells ( Before running the following sample, please make sure that your control contains columns, and at least an item ):
With Grid1.Items Dim h As HITEM, f As HCELL h = .FirstVisibleItem f = .SplitCell(h, 0) .CellValue(, f) = "inner cell 1" f = .SplitCell(, f) .CellValue(, f) = "inner cell 2" End With
The following C++ sample splits the first visible cell in two cells:
#include "Items.h" CItems items = m_grid.GetItems(); COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR; COleVariant vtSplit = items.GetSplitCell( COleVariant( items.GetFirstVisibleItem() ), COleVariant( long(0) ) ); items.SetCellCaption( vtMissing, vtSplit, COleVariant( "inner cell" ) );
The following VB.NET sample splits the first visible cell in two cells:
With AxGrid1.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:
EXGRIDLib.Items items = axGrid1.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.Grid1.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.Grid1.Template = s endwith