?
Solved

Sorting table.

Posted on 2000-05-06
4
Medium Priority
?
178 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 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

741 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