Solved

DBGrid + Table sorting

Posted on 1998-11-05
2
224 Views
Last Modified: 2010-04-04
Hi

Every time I add a record to a table (shown in a DBGRid), I want the table and the grid to sort itself based on the value in one of the fields (an integer) - anyone give me the best way of doing this.

Thanks.
0
Comment
Question by:cavalry
[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 Comments
 
LVL 1

Expert Comment

by:Greedy
ID: 1345807
The best way to do this would be to index the Integer field and then set the IndexFieldsName property of the TTable to it.  If you are useing a TQuery you can put an ORDER BY in your SELECT statment to sort them too.
0
 
LVL 2

Accepted Solution

by:
k6__ earned 10 total points
ID: 1345808
make Index Files =) (use Database Desktop to do them permanant)
 .. eg On Index File by Name or By Address etc.
eg.. in your code use this :

Table1.Open;
Table1.IndexName := 'code'; (sorts by code)

It also speed up all your database functions =) (like search)


0

Featured Post

Technology Partners: 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month7 days, 12 hours left to enroll

632 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