Color in Sorted Columns

16 visualizações
Pular para a primeira mensagem não lida

Alejandro AG

não lida,
16 de mar. de 2022, 11:40:2816/03/2022
para Rosi Delphi Components
I know we can show the arrow in the sorted column(s)
I can't found change Font or Backgroud colors of sorted column(s), it is possible?

Tomas Rosinsky

não lida,
17 de mar. de 2022, 02:55:5817/03/2022
para Rosi Delphi Components
Do you mean column title cell or data cells?
Title cell is usually defined by themes and cannot be changed easilly, anyway you can you OnDrawCellBackground or OnDrawTitleCellEnd events.
Data cells be changed easilly by custom code in the OnGetCellParams where you can check Field parameter and current sorting by any possible way and set colors according your needs:

    { returns position of FieldName in SortFieldName (0=not found) }
    function PosInSortField(const FieldName: string): integer;
    { returns array of sort fields }
    function SortFieldNamesArr: TSortFieldNames;    
    { Defines which columns has sort marker, supports MultiField (e.g. FirtsName,LastName) }
    property SortFieldName: string read FSortFieldName write SetSortFieldName;

I hope it helps
Tomas
Dne středa 16. března 2022 v 16:40:28 UTC+1 uživatel aag.co...@gmail.com napsal:
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem