取当前cxGrid

use
  SmartGrid

var
  aGridView: TSmartGridDBBandedTableView;
  aGrid: TcxGrid;
begin
  ..
  //当前Grid(多个Grid时)
  if Self.ActiveControl is TcxGridSite then
  begin
    aGridView := TcxGridSite(Self.ActiveControl).ViewInfo.GridView as TSmartGridDBBandedTableView;
    aGrid := aGridView.GetParentComponent as TSmartGrid;
  end;
  ..
end

你可能感兴趣的:(取当前cxGrid)