Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 19 Feb 2020, 23:24

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 21 Nov 2017, 07:07 
Offline

Joined: 21 Nov 2012, 01:56
Posts: 119
Hi Dear Team,
Good day.
Is there a way to highlight current column title when the current cell is moving around the DBGridEh?
My use case is: Too many columns in the grid, the user couldn't easily find which column he is working on.
Thanks.


Attachments:
change col title color.jpg
change col title color.jpg [ 57.45 KiB | Viewed 1385 times ]
Top
 Profile  
 
PostPosted: 03 Dec 2019, 07:26 
Offline

Joined: 21 Nov 2012, 01:56
Posts: 119
UP
geohuazai wrote:
Hi Dear Team,
Good day.
Is there a way to highlight current column title when the current cell is moving around the DBGridEh?
My use case is: Too many columns in the grid, the user couldn't easily find which column he is working on.
Thanks.


Top
 Profile  
 
PostPosted: 03 Dec 2019, 18:37 
Offline

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

Yes, you can.
Use TDBGridEh.OnGetTitleParams event like this.

Code:
procedure TForm1.FormCreate(Sender: TObject);
begin
  DBGridEh1.TitleParams.FillStyle := cfstGradientEh;
end;

procedure TForm1.DBGridEh1ColEnter(Sender: TObject);
begin
  DBGridEh1.InvalidateTitle;
end;

procedure TForm1.DBGridEh1GetTitleParams(Grid: TCustomDBGridEh;
  Params: TDBGridDrawTitleCellParamsEh);
begin
  if (Params.Column.Index = DBGridEh1.SelectedIndex) then
  begin
    Params.Color := clWebOrange;
  end;
end;


Attachments:
sshot-62.png
sshot-62.png [ 29.74 KiB | Viewed 186 times ]

_________________
Best regards
EhLib Support Team
Top
 Profile  
 
PostPosted: 11 Dec 2019, 12:10 
Offline

Joined: 24 Aug 2018, 13:15
Posts: 22
Location: Brazil
Is it possible to do this in the EhLib source code so you don't have to repeat this encoding every time you need it? Because I tried to implement and it didn't work


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 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:  
cron
Powered by phpBB® Forum Software © phpBB Group