Board index » delphi » Sorting DBGrid using an integer field

Sorting DBGrid using an integer field

I have a DBtable (Paradox style) with 4 fields

1. integer field (ixPrimary)
2. string field (ixCaseInsensitive)
3. integer
4. integer

When i display that table in a DBGrid the table is sorted ascending
using the string field.

I need to display the table sorted by the first field.

Q: How can i define how a table is sorted ??? I thought this was the
PRIMARY definition ????

Serge

 

Re:Sorting DBGrid using an integer field


By default the table will be displayed in Primary Key Order (ascending or
Descending). Using a TQuery object you can sort the table on any column
(make sure it's indexed

Steve

Serge Wagener <wagene...@istvax.ist.lu> wrote in article
<3236BDD9.2...@istvax.ist.lu>...

Quote
> I have a DBtable (Paradox style) with 4 fields

> 1. integer field (ixPrimary)
> 2. string field (ixCaseInsensitive)
> 3. integer
> 4. integer

> When i display that table in a DBGrid the table is sorted ascending
> using the string field.

> I need to display the table sorted by the first field.

> Q: How can i define how a table is sorted ??? I thought this was the
> PRIMARY definition ????

> Serge

Other Threads