TCRDBGrid LoadFromFile doesnt load sortorder

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
iskywalker
Posts: 16
Joined: Mon 25 Jun 2007 15:00

TCRDBGrid LoadFromFile doesnt load sortorder

Post by iskywalker » Mon 20 Aug 2007 10:52

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...

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 20 Aug 2007 13:00

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).

iskywalker
Posts: 16
Joined: Mon 25 Jun 2007 15:00

Post by iskywalker » Mon 20 Aug 2007 17:39

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!

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 21 Aug 2007 07:51

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.

Post Reply