Page 1 of 1

TCRDBGrid LoadFromFile doesnt load sortorder

Posted: Mon 20 Aug 2007 10:52
by iskywalker
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...

Posted: Mon 20 Aug 2007 13:00
by Antaeus
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).

Posted: Mon 20 Aug 2007 17:39
by iskywalker
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!

Posted: Tue 21 Aug 2007 07:51
by Antaeus
I received your example, but I have not found the 27112006164216.bfa file. Could you send it to me? Also include an SQL script to create and fill the arc_27112006164216 table.