Page 1 of 1

how to sort data in ZTable ?

Posted: 26.01.2006, 08:19
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

Posted: 26.01.2006, 11:09
by zippo
I wish I knew.. Today I'm forced to do it via SQL... Developers, any ideas?

Posted: 26.01.2006, 20:24
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

Posted: 05.03.2006, 10:25
by zippo
And how to sord descendant or inverse the sort order?

Posted: 05.03.2006, 13:47
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

Posted: 05.03.2006, 15:57
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.

Posted: 06.03.2006, 00:14
by markd_mms
Use the SortedFields property...

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