Page 1 of 1

Regular (non-custom) sorting...

Posted: Fri Jul 09, 2021 3:20 pm
by 18689076
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.

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

Posted: Tue Jul 13, 2021 4:01 pm
by Marc
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

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

Posted: Wed Jul 14, 2021 7:09 am
by 18689076
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