Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 15 Jun 2024, 12:07

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Highlight sorted column
PostPosted: 18 May 2024, 12:25 
Offline

Joined: 29 Oct 2013, 11:58
Posts: 16
hi, i want to spotlight (highlight) sorted column ..howto do ?


Top
 Profile  
 
PostPosted: 29 May 2024, 18:16 
Offline

Joined: 08 May 2014, 18:06
Posts: 667
Hello

If you want to change the color of the columns currently being sorted by, you can use the TDBGridEh.SortMarkingChanged event as follows.

Code:
procedure TForm1.DBGridEh1SortMarkingChanged(Sender: TObject);
begin
  DBGridEh1.DefaultApplySorting;

  for var i := 0 to DBGridEh1.Columns.Count - 1 do
  begin
    if DBGridEh1.Columns[I].Title.SortIndex > 0 then
      DBGridEh1.Columns[I].Color := $00E6F2FF
    else
      DBGridEh1.Columns[I].Color := DBGridEh1.Color;
  end;
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 07 Jun 2024, 19:14 
Offline

Joined: 29 Oct 2013, 11:58
Posts: 16
EhLibSupport wrote:
Hello

If you want to change the color of the columns currently being sorted by, you can use the TDBGridEh.SortMarkingChanged event as follows.

Code:
procedure TForm1.DBGridEh1SortMarkingChanged(Sender: TObject);
begin
  DBGridEh1.DefaultApplySorting;

  for var i := 0 to DBGridEh1.Columns.Count - 1 do
  begin
    if DBGridEh1.Columns[I].Title.SortIndex > 0 then
      DBGridEh1.Columns[I].Color := $00E6F2FF
    else
      DBGridEh1.Columns[I].Color := DBGridEh1.Color;
  end;
end;


worked perfectly ... thank you very very much.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group