Skip to main content

TcxCustomVerticalGrid.Add(TcxCustomRowClass) Method

Adds a new row to the control.

Declaration

function Add(ARowClass: TcxCustomRowClass): TcxCustomRow;

Parameters

Name Type
ARowClass TcxCustomRowClass

Returns

Type
TcxCustomRow

Remarks

The Add method can be used to create and add a new row to the vertical grid control.

The ARowClass parameter specifies the class of the row to be created. Note that this parameter should never be nil. The TcxCustomVerticalGrid descendant classes check whether they can contain a row of the type passed via the parameter. If the type is not acceptable, a cxVerticalGridError exception is raised. The following table displays the types of row that TcxCustomVerticalGrid descendants can contain.

TcxCustomVerticalGrid descendants

TcxCustomRow descendants

TcxCategoryRow

TcxEditorRow

TcxMultiEditorRow

TcxDBEditorRow

TcxVerticalGrid

+

+

+


TcxVirtualVerticalGrid

+

+

+


TcxDBVerticalGrid

+



+

TcxRTTIInspector

+


+


By default, the new row is added to the end of the first level’s rows collection. The new row’s position is specified via the Row.Index property. The following sample demonstrates how to add a new row to the beginning of the first level’s rows collection:

VerticalGrid1.Add(TcxCategoryRow).Index := 0;

To add a new row as a child of another one, you should use the AddChild method.

Also, you can copy all the rows from another vertical grid control via the AssignRows method.

See Also