Solved

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

13 Experts available now in Live!

Get 1:1 Help Now