Solved

Sorting table.

Posted on 2000-05-06
4
167 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now