Regular (non-custom) sorting...

TeeGrid VCL / FMX for Embarcadero RAD Studio, Delphi, C++ Builder and Lazarus Free Pascal.
Post Reply
Jonsafi
Newbie
Newbie
Posts: 9
Joined: Tue Jul 14, 2020 12:00 am

Regular (non-custom) sorting...

Post by Jonsafi » Fri Jul 09, 2021 3:20 pm

Hello,

I know that there is a full example on custom sorting,
but understood that the simplest way
for sorting w/o customization would be using Sortby
as in the following:

Code: Select all

 MyTeeGrid.Header.Sortable := True;
MyTeeGrid.Data.Sortby(AColumn);
// the following also does not sort (GData_Full is of type TStringsData)
// it just call does a dummy call.
GData_Full.Sortby(AColumn);

However, the above code does not sort, even though
AColumn points at an active column,
it simply calls the following function.
function TTeeGrid.GetData: TVirtualData;
begin
result:=Grid.Data;

End;

Currently am testing this with D2009. Am probably missing
something, so would be much obliged for your help here,
Kind regards, Sami.

Marc
Site Admin
Site Admin
Posts: 1205
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Regular (non-custom) sorting...

Post by Marc » Tue Jul 13, 2021 4:01 pm

Hello Sami,

It looks like the VirtualData SortBy method is intended to permit a custom implementation (overriden class) for Sort. No solution is provided there.

If the techniques outlined in the example are not applicable for your need perhaps we can help suggest an alternative.

Regards,
Marc Meumann
Steema Support

Jonsafi
Newbie
Newbie
Posts: 9
Joined: Tue Jul 14, 2020 12:00 am

Re: Regular (non-custom) sorting...

Post by Jonsafi » Wed Jul 14, 2021 7:09 am

Hello Marc,

Thanks for the help, so if there is some simple solution, would
be very grateful for any hints. Am using

Code: Select all

GData_Full[acol,arow]  
to
populate the data in the grid.

Regards, Sami

Post Reply