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

TcxCustomGrid.Levels Property

Provides access to the collection of root grid levels within a grid control.

#Declaration

Delphi
property Levels: TcxGridLevel read; write;

#Property Value

Type
TcxGridLevel

#Remarks

Use the Levels property to access the collection of root grid levels within a grid control. Each grid level in turn may contain child levels, thus constructing a data hierarchy. To access child grid levels, use the TcxGridLevel.Items property. To access the currently active root grid level, use the ActiveLevel property.

The following code iterates the child levels of the first root grid level and disables filtering for the associated grid Views (but ignores Card Views).

var
  I: Integer;
  AGridView: TcxCustomGridView;
//...
  for I := 0 to cxGrid1.Levels[0].Count - 1 do
  begin
    AGridView := cxGrid1.Levels[0].Items[I].GridView;
    if AGridView is TcxGridTableView then
      TcxGridTableView(AGridView).OptionsCustomize.ColumnFiltering := False;
  end;
See Also