Solved

Sorting table.

Posted on 2000-05-06
4
175 Views
Last Modified: 2010-04-04
Hi,

In the application I am developing, a TTable and a DBGrid is used to search for addresses. I'm using a Paradox-table for the data storage.

I want the DBGrid to be sorted on the Name-field. This field (Name) as well as the field Number do have an index.

How can I give the TTable or DBGrid the right sorting?

Thank you for helping.
0
Comment
Question by:roosiedb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
kotik earned 50 total points
ID: 2784281
Hi!
Simply set the TTable.IndexName  or TTable.IndexFieldNames property.

F.e.:
  Table1.IndexName := 'NAME_IDX';
or
  Table1.IndexFieldNames := 'NAME_IDX; NUMBER_IDX'; // <- this will sort first by name, then by number

Note:      IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other.

DBGrid will show data as it is sorted in its DataSet property.

Regards,
  Kot.
0
 

Author Comment

by:roosiedb
ID: 2785318
Thank you, this is working OK.

Please let me grade you for the points...
0
 
LVL 9

Expert Comment

by:ITugay
ID: 2785398
click "accept comment as answer"
0
 

Author Comment

by:roosiedb
ID: 2785560
Sorry, I didn't see that button.

Thank you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question