Solved

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

Posted on 2006-10-19
2
1,540 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

710 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