var i, j: integer; begin for i:=0 to Self.ControlCount - 1 do begin if Self.Controls[1] is tdbgrideh then begin for j := 0 to TDBGridEh(Self.Controls[1]).Columns.Count - 1 do begin if ... then begin TDBGridEh(Self.Controls[1]).Columns[j].Visible := False; end; end; end; end; end;
i, j: integer;
begin
for i:=0 to Self.ControlCount - 1 do
begin
if Self.Controls[1] is tdbgrideh then
begin
for j := 0 to TDBGridEh(Self.Controls[1]).Columns.Count - 1 do
begin
if ... then
begin
TDBGridEh(Self.Controls[1]).Columns[j].Visible := False;
end;
end;
end;
end;
end;
if ... then
判断的看Ini了
spdbgrid1.Columns.Grid.Fields[0].Visible:=false;
spdbgrid1.Columns[0].Visible:=false;