Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

14 Experts available now in Live!

Get 1:1 Help Now