TTMSFMXLiveGrid sorting

Hi,


Has anything changed recently with regard to sorting on columns?  Clicking on a column changes the triangle status but no change in the list either ascending or descending.  I have Sorting.Columns = scAll, Sorting.Mode = gsmNormal, and these event handlers...

procedure TFormAtlas.DBGridCountryCustomCompare(Sender: TObject; Value1,
  Value2: string; var res: Integer);
begin
  res := CompareStr(Value1, Value2);
end;

procedure TFormAtlas.DBGridCountryCanSortColumn(Sender: TObject;
  ACol: Integer; var Allow: Boolean);
begin
  Allow := True;
  NSortCol := ACol;
end;

Am I forgetting something or perhaps a new addition to the property list from an update.  I haven't tested this in quite a while on the FMX side so it might be several versions back, but not more than a year.

Hi, 


Sorting still works as expected here, can you send us a sample with the behavior you get when sorting? There have been changes in LiveBindings fixed row handling but this should make a difference for the non-LiveBindings enabled grid. Please note that sorting cannot be combined with a LiveBindings enabled grid.

Kind Regards, 
Pieter

Pieter,

This was working with previous versions !
Is there a workaround for this ?

It's unclear if this issue is the same as your issue. We have tested sorting here in our sorting demo and this still works as expected. Sorting in combination with LiveBindings isn't supported. To sort the grid you need to sort the dataset, which will automatically update the grid. 

I'm using LiveBindings in one grid and not in another (which only uses TTMSFMXGrid).  The TTMSFMXGrid sorts fine without event handlers but doesn't use live binding.  I had to switch to a Live grid because the TClientDataSet files are quite large (using the Geonames.org data converted to binary) and just loading the files was taking minutes on a TTMSFMXGrid.  The TTMSFMXLiveGrid is much faster loading the *.cds files for each country.


I have an iMac 3.2 GHz i5 processor with 8 GB ram.  The Canada file takes about 4 seconds to load on the windows side, but about 15 seconds to load on the Mac side.  I may have to break up the larger country databases such as Canada, Russia and Mexico into their provinces for faster loading time.  AFAIK, FMX needs to use live bindings as that is the only method of tying data to objects without resorting to a different database technology.  Perhaps it's time to move to FireDAC?


Would I be correct in assuming that sorting a live grid would require reloading of the CDS file after done?

Hi, 


As already mentioned, sorting needs to be performed on dataset level, not on grid level, which will automatically refresh the data in the grid. There is no need to reload the dataset after sorting as it will already be sorted.