Back to Devexpress

TcxCustomGrid.Levels Property

vcl-cxgrid-dot-tcxcustomgrid-1eacdc43.md

latest2.0 KB
Original Source

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).

delphi
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;
cpp
TcxCustomGridView *AGridView;
//...
  for(int I = 0; I < cxGrid1->Levels[0]->Count; I++)
{
    AGridView = cxGrid1->Levels[0]->Items[I]->GridView;
    if(AGridView->InheritsFrom(TcxGridTableView))
      dynamic_cast<TcxGridTableView*>(AGridView)->OptionsCustomize->ColumnFiltering = false;
}

See Also

TcxCustomGrid.RootLevelOptions

TcxCustomGrid.RootLevelStyles

Data Representation

Working with Levels

TcxCustomGrid Class

TcxCustomGrid Members

cxGrid Unit