Home > Back-end >  CxGrid dynamically add column, the column with StoreToIniFile information saved in the Ini file, but
CxGrid dynamically add column, the column with StoreToIniFile information saved in the Ini file, but

Time:10-04

CxGrid dynamically add column, the column with StoreToIniFile information saved in the Ini file, but failed, warrior;
The source code is as follows:

Procedure TForm1. CxButton1Click (Sender: TObject);
Var I: Integer;
The begin
Inherited;
//
//cxGrid1DBTableView1. RestoreDefaults;
CxGrid1DBTableView1. StoreToIniFile (' D: \ DD Ini ');
end;


Procedure TForm1. CxButton2Click (Sender: TObject);
The begin
CxGrid1DBTableView1. RestoreFromIniFile (' D: \ DD Ini ');
end;

Procedure TForm1. FormCreate (Sender: TObject);
Var I: Integer;
The begin
ADOQuery1. Open;
For I:=0 to ADOQuery1. Do FieldCount - 1
With cxGrid1DBTableView1 do
The begin
CreateColumn;
The Columns [I] DataBinding. FieldName:=ADOQuery1. Fields [I] FieldName.
end;
end;

CodePudding user response:

You D packing list cannot be stored documents,

CodePudding user response:

Or because you are dynamically add, when load is not correct