Skip to main content

TcxCustomGridTableViewData.Collapse(Boolean) Method

Collapses all records within the current View recursively.

Declaration

procedure Collapse(ARecurse: Boolean); virtual;

Parameters

Name Type
ARecurse Boolean

Remarks

Use the Collapse method to collapse all rows within the View. Only master rows, group rows and cards (TcxGridMasterDataRow, TcxGridGroupRow and TcxGridCard) implement the collapse/expand operations.

The Collapse method applied to a master View enables you to collapse all records within corresponding detail Views. To do this, set the ARecurse parameter to True. If ARecurse is False, only rows within a master View are affected.

A detail View will have instances created (“clones”) for each visible detail. To collapse rows within all open details of a particular View, you need to iterate through all clones and call their Collapse methods. Refer to the Data Representation topic for information on View clones. The following code performs a recursive collapse of rows within all instances of the detail tvOrders View:

var
  I: Integer;
//...
  with tvOrders do
    for I := 0 to CloneCount - 1 do
      TcxGridTableView(Clones[I]).ViewData.Collapse(True);
See Also