Recent

Author Topic: RxDBGrid Sort Question  (Read 1780 times)

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
RxDBGrid Sort Question
« on: March 05, 2019, 08:53:22 pm »
Hi,

I'm trying to use the sort feature of the RxDBGrid, but it just keeps crashing.
When I look at the code it appears that the SortEngine is Nil, but I'm not sure how to set it up.

Code: Pascal  [Select][+][-]
  1. procedure TRxDBGrid.SetAutoSort(const AValue: boolean);
  2. var
  3.   S: string;
  4.   Pos: integer;
  5. begin
  6.   if FAutoSort = AValue then
  7.     exit;
  8.   FAutoSort := AValue;
  9.   if Assigned(DataSource) and Assigned(DataSource.DataSet) and
  10.     DataSource.DataSet.Active then
  11.   begin
  12.     S := DataSource.DataSet.ClassName;
  13.     if RxDBGridSortEngineList.Find(S, Pos) then
  14.       FSortEngine := RxDBGridSortEngineList.Objects[Pos] as TRxDBGridSortEngine
  15.     else
  16.       FSortEngine := nil;
  17.     FSortColumns.Clear;
  18.   end;
  19. end;          

Has anyone used this and got it working?

Thanks
Dave
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

 

TinyPortal © 2005-2018