Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomGridTableViewData.Collapse(Boolean) Method

Collapses all records within the current View recursively.

#Declaration

Delphi
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