Lazarus

Programming => General => Topic started by: arneolav on March 05, 2021, 05:42:29 pm

Title: Sort more String Grid columns
Post by: arneolav on March 05, 2021, 05:42:29 pm
I'v not found any solution on sorting more than one column in a stringrid so I made an, may be "quick an dirty simple solution.
Then main principle is to concatenate values into one field an sort this field, all done in event CompareCells.
In testing this seems to work very well.
Any comments are welcome!




Title: Re: Sort more String Grid columns
Post by: Handoko on March 05, 2021, 06:04:16 pm
Bookmarked. It will be useful for my next projects.

Thank you for sharing it.
Title: Re: Sort more String Grid columns
Post by: arneolav on March 05, 2021, 06:53:42 pm
You are welcome.

Attached som more tips concerning sorting.

In the grid, Object Inspector, I have ColumnClickSorts set to false.
Option goThumbTracking = true.

Read more here:
https://wiki.freepascal.org/Grids_Reference_Page
TinyPortal © 2005-2018