how to sort data in ZTable ?

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
OverseasHost.com
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 26.01.2006, 08:13

how to sort data in ZTable ?

Post by OverseasHost.com »

hi all

how to sort data in ZTable ?

i opened a ZTable , and set IndexFieldNames to the primary key

when i preview in dbgrid , and insert some value and insert the primary key not in order ( for ex. 4 value after 2 ) it is not reordered to the primary key

what could i do to make the ZTable Reorder automatically with the Primary Key


Thanx
http://www.OverseasHost.com quality hosting , quality support
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

I wish I knew.. Today I'm forced to do it via SQL... Developers, any ideas?
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post by btrewern »

See SortedFields property.

Regards,

BTW TZTable components and their like are just plain bad! Best to use TZQuery and select only the fields you want.

Ben
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

And how to sord descendant or inverse the sort order?
silviogs
Junior Boarder
Junior Boarder
Posts: 42
Joined: 24.08.2005, 12:54
Location: The Most Oriental Point of America - João Pessoa - Brazil
Contact:

Post by silviogs »

Hi

use the component zquery it would be easier for you. In the property SQL types:

select * from your table
order by field asc (desc)

Respectfully

Silvio Guedes
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

I do use ZQuery, but I've done a simple routine to do the client-side sorting by clicking on the grit captions... I old Zeos there were two properties SortInverse and Sort.
In Zeos 6.x they are missing.
markd_mms
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 30.09.2005, 02:08

Post by markd_mms »

Use the SortedFields property...

e.g.
SortedFields = "1 ASC, 2 DESC";
Post Reply