Link to home
Start Free TrialLog in
Avatar of BadBart
BadBart

asked on

Sorting within a database grid

I want to be able to have the data listed in a dbGrid be sorted by one (or two) of the fields. The dbGrid's datasource comes from a table which has a master datasource.

I tried specifying the field name I wanted to sort by in the "IndexFieldNames" property, but had a "Index out of range" error.
Avatar of ronit051397
ronit051397

Did you try SQL?
Avatar of BadBart

ASKER

The supervisor of the project does not regard SQL very highly as it takes a much longer time to process.

So, I'm only to use things such as Findkey() and FieldByName().
Could you be more specific in telling us what type of database table you have (dbf or paradox) and what are the indexes you have created for the table. This would be more useful in getting a proper solution for your needs.
I know this is a stupid question, but i'm going to ask it anyway :

When using IndexFieldNames you have to define as index field names in your table structure. Have you done this. Primary and secondary indexes???

Have fun,
c.u. ZifNab;

ASKER CERTIFIED SOLUTION
Avatar of jturpin
jturpin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BadBart

ASKER

Sorry for the delay! Thanks heaps..!