Delphi & C++ Builder components library
and Software development
 
 
 

rDBGrid - how to implement sorting functions

Base Dataset component does not implement sorting functions. So each dataset type implement sorting in different way and therefore correct Sorter component according particular dataset type must be used to sort data in rDBGrid.

There is prepared package RosiDBSorters_*.dpk which contain sorters for standard dataset types:

  • ADO (dbGo)
  • DBX (dbExpress)
  • ClientDataset
  • FireDac (Embarcadero) - for Delphi XE5 and higher, you can add unit rDBGridSorter_FireDac.pas for other version

Another Sorters for following dataset type is prepared too and can be added easily to the Sorter package if user have installed dataset of that types:

  • UniDac (DevArt) - add unit rDBGridSorter_UniDac.pas
  • MySQLDac (TMySQLDataset) - add unit rDBGridSorter_MySqlDac.pas
  • ABS Table - add unit rDBGridSorter_AbsDB.pas
  • ADONis (TWCustomADODataSet) - add unit rDBGridSorter_ADONis.pas
  • ElevateDB (TEDBTable) - add unit rDBGridSorter_ElevateDB.pas
  • DBISAM - add unit rDBGridSorter_DBISAM.pas
  • ZEOS - add unit rDBGridSorter_Zeos.pas
Sorter for any other dataset type can be prepared very easily (it contains only one procedure, see other prepared type for details).

How to implement sorting:

  • install package RosiDBSorters_*.dpk (part of Rosi_DBComp group project)
  • select correct Sorter components according dataset type used in your application and place it to Main form or Datamodule
  • place rDBGrid to any form
  • set property rDBGrid.Sorter to your Sorter component

Open documentation page.

Go back