Forum > LCL

TStringGrid ColumnClickSort - how to 'unsort' ?

(1/1)

FrankBKK:
TStringGrid allows to change the sorting of a column via ColumnClickSort when clicking on the Header, click again to switch Asc/Desc sort order.

How can I get back the original, unsorted view ?





Zvoni:
You can't.
Except if you saved the "original" sort somewhere

FrankBKK:
Thanks for the quick reply - that's bad though ....

What is the best approach to circumvent this ?

A secondary backup grid to restore the original sort order seems like overkill and to add an add. sort column is something I try to avoid - are there any other options ?

Awkward:
why not to add hidden column with numbers for original order and sort by it when needs?

Zvoni:
IIRC, the row-Property (or was it rows?) is of type TStrings, so a TStringList could/should work

Navigation

[0] Message Index

Go to full version