Skip to main content

TdxSpreadSheetTableItemGroups.Add(Integer,Integer) Method

Adds a number of specified table items to a new or existing table item group within the hierarchy.

Declaration

procedure Add(AStartIndex: Integer; AFinishIndex: Integer); overload;

Parameters

Name Type
AStartIndex Integer
AFinishIndex Integer

Remarks

This procedure creates a group containing a single column or row whose zero-based index within the Table View worksheet’s content area is passed as the AIndex property.

The second overloaded variant creates a group of successive columns or rows starting and ending with the table items whose zero-based indexes are passed as the AStartIndex and AFinishIndex parameters, respectively:

If table items within the specified range are already grouped, the Add procedure creates a nested table item group instead:

If the Add procedure is attempting to create a table item group whose node level exceeds the dxSpreadSheetMaxOutlineLevel global constant value, the EdxSpreadSheetError exception is raised:

In order to create two individual column or row groups at the same nesting level contained within the same parent group (or root node), you need to separate them from each other by at least one column or row which does not belong to any group at the current nesting level:

Otherwise, the newly created groups are merged into one:

Like the table item group’s StartIndex and FinishIndex properties, the Add procedure can be used to expand existing groups by adding adjacent table items or table item ranges to them.

Note

If you need to delete or shrink a particular group of table items, call the Delete procedure. If you need to delete all groups from the root node, invoke the DeleteAll procedure.

See Also