Solved

Programatically Auto-Sort TAdvStringGrid using its in-built sort functionality

Posted on 2006-10-19
2
1,560 Views
Last Modified: 2012-05-05
Title says it all, but basically I want to sort a TAdvStringGrid.

The manual sort properties to set when doing a multi column sort on a TAdvStringGrid (property SortSettings: Show = True, IndexShow = True).

What I would like to do is call this via code rather than on the click of the title headers, and I would like to do a multi sort simulating left clicking one column and then shift left click a second.

0
Comment
Question by:mikelittlewood
[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 15

Author Comment

by:mikelittlewood
ID: 17772182
Nevermind, after a little digging I found the answer.
Here it is for anyone who might need for the future.
Ill see if I can just get this question closed off but not deleted.

with AdvStringGrid do
begin
      SortIndexes.Clear;
      SortIndexes.AddIndex(3, True);  // first parameter is column number, second is if you want to sort ascending
      SortIndexes.AddIndex(2, True);
      QSortIndexed;
end;
0
 
LVL 1

Accepted Solution

by:
kodiakbear earned 0 total points
ID: 17780619
Closed, 125 points refunded.
kb
Experts Exchange Moderator
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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month10 days, 19 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