Hi!
I am trying use loadfromfile for the columns of a TCRDBGrid:
dbgrd_TrefferListe.Columns.LoadFromFile(filename);
but when i check the order for making my sql request i cant see the order (although it is right draw on the display which column is selected):
for licounter := 0 to dbgrd_TrefferListe.columns.Count-1 do
begin
if dbgrd_Trefferliste.Columns.items[licounter].sortorder soNone then
begin
lstemp:= dbgrd_Trefferliste.Columns.items[licounter].DisplayName;
if dbgrd_Trefferliste.Columns.items[licounter].sortorder = soAsc then
begin
lstemp1:=' asc';
end
else
begin
lstemp1:=' desc';
end;
end;
end;
I get always a soNone...
TCRDBGrid LoadFromFile doesnt load sortorder
I checked this issue, but could not reproduced this problem. Saveing/Loading columns to/from file is implemented in the TDBGridColumns class of the
DBGrids unit. This unit is a part of Delphi, so you have its sources.
If this does not help to solve this problem, please describe it in more details, or send me a complete small sample at evgeniyD*crlab*com to demonstrate the problem.
Also supply me the following information:
- exact version of MyDAC. You can see it in the About sheet of TMyConnection Editor;
- exact version of your IDE (including personality name for Delphi 2005, and BDS 2006).
DBGrids unit. This unit is a part of Delphi, so you have its sources.
If this does not help to solve this problem, please describe it in more details, or send me a complete small sample at evgeniyD*crlab*com to demonstrate the problem.
Also supply me the following information:
- exact version of MyDAC. You can see it in the About sheet of TMyConnection Editor;
- exact version of your IDE (including personality name for Delphi 2005, and BDS 2006).
-
iskywalker
- Posts: 16
- Joined: Mon 25 Jun 2007 15:00
Thx for the response!
Seems i can reproduce it by:
MyConnection1.Connect;
CRDBGrid1.Columns.LoadFromFile('27112006164216.bfa');
MyQuery1.Execute;
if i do:
MyConnection1.Connect;
MyQuery1.Execute;
CRDBGrid1.Columns.LoadFromFile('27112006164216.bfa');
it works. So why should i do the first MyQuery1.execute?
I send the file, if you need a Project i can set too.
My Mydac version is:
Mydac 5.00.1.7
My Delphi version:
Delphi 7.1
I will send the 27112006164216.bfa file and a project top you per mail as attachment.
thx!
Seems i can reproduce it by:
MyConnection1.Connect;
CRDBGrid1.Columns.LoadFromFile('27112006164216.bfa');
MyQuery1.Execute;
if i do:
MyConnection1.Connect;
MyQuery1.Execute;
CRDBGrid1.Columns.LoadFromFile('27112006164216.bfa');
it works. So why should i do the first MyQuery1.execute?
I send the file, if you need a Project i can set too.
My Mydac version is:
Mydac 5.00.1.7
My Delphi version:
Delphi 7.1
I will send the 27112006164216.bfa file and a project top you per mail as attachment.
thx!