procedure cxGrid_ExpandGroupLevel(AView: TcxGridTableView; ALevel: Integer); var i: Integer; begin if ALevel < 0 then Exit; AView.BeginUpdate; try AView.DataController.Groups.FullExpand; for i := AView.DataController.RowCount - 1 downto 0 do if AView.DataController.GetRowInfo(i).Level > ALevel then AView.DataController.Groups.ChangeExpanding(i, False, True); finally AView.EndUpdate; end; end; procedure cxGrid_ExpandGroupColumn(AView: TcxGridTableView; Column: TcxGridColumn); begin if Column.GroupIndex >= 0 then cxGrid_ExpandGroupLevel(AView, Column.GroupIndex); end; |