procedure TfrmGridStore.GridLoadFromIni;
begin
FAGrid.RestoreFromIniFile(IniFile,True,false,[gsoUseFilter],FSecName);
end;
procedure TfrmGridStore.GridSaveToIni;
begin
FAGrid.StoreToIniFile(IniFile,false,[gsoUseFilter], FSecName);
end;
class procedure TfrmGridStore.LoadGridStyle(
Grids: array of TcxCustomGridTableView; secNames: array of String);
var i : integer;
begin
for i := 0 to high(grids) do
begin
with TFrmGridStore.Create(nil, Grids[i], secNames[i]) do
begin
GridLoadFromIni;
Free;
end;
end;
end;
procedure TfrmGridStore.ShowGridColumns;
var
i : integer;
begin
for i := 0 to FAGrid.ItemCount - 1 do
begin
chklstColum.Items.Add(FAGrid.Items[i].Caption);
chklstColum.Checked[i] := FAGrid.Items[i].Visible;
end;
end;
procedure TfrmGridStore.btnOKClick(Sender: TObject);
var
i ,j: integer;
begin
for i := 0 to FAGrid.ItemCount - 1 do
begin
for j := 0 to chklstColum.Items.Count - 1 do
begin
if FAGrid.Items[i].Caption = chklstColum.Items.Strings[j] then
FAGrid.Items[i].Visible := chklstColum.Checked[j];
end;
end;
GridSaveToIni;
GridLoadFromIni;
Close;
end;
procedure TfrmGridStore.btnCancelClick(Sender: TObject);
begin
close;
end;