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

TcxPivotGridField.ExpandAll Method

In This Article

Expands all the columns or rows that correspond to the current field.

#Declaration

Delphi
procedure ExpandAll;

#Remarks

When the current field is placed within the column header area the ExpandAll method expands all the grouping columns that correspond to this field.

When the current field is placed within the row header area the ExpandAll method expands all the grouping rows that correspond to this field.

To expand or collapse a specific grouping item (a grouping row or column), you need to locate it within the pivot grid’s ViewData display information and set the item’s Expanded property to an appropriate value.

The following code snippet demonstrates how to expand the grouping row that corresponds to a grouping value of 1 of the DBPivotGridPurchaseDate field.

var
  AGroupItem: TcxPivotGridGroupItem;
begin
  // ...
  DBPivotGrid.BeginUpdate;
  with DBPivotGrid.ViewData do
  begin
    for I := 0 to RowCount - 1 do
    begin
      AGroupItem := Rows[I].GetGroupItemByField(DBPivotGridPurchaseDate);
      if (AGroupItem <> nil) and (AGroupItem.Value = 1) then
      begin
        AGroupItem.Expanded := True;
        break;
      end;
    end;
  end;
  DBPivotGrid.EndUpdate;
end;
See Also