Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 27 Apr 2024, 15:31

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 31 Jul 2023, 07:38 
Offline

Joined: 31 Jul 2023, 07:34
Posts: 7
How to colorize the first three elements in DBLookUpComboBoxEh.

I tried the two functions below but it didn't work.
DropDownBoxGetCellParams
DropDownBoxDrawColumnCell.

Can you help me?

Thanks!


Top
 Profile  
 
PostPosted: 01 Aug 2023, 00:54 
Offline

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


You can't highlight cells in dropdownbox by row position
but you can highlight by values of the current record.

Using OnDropDownBoxGetCellParams event
Like this:
Code:
procedure TfrEditControls.DBLookupComboboxEh3DropDownBoxGetCellParams(
  Sender: TObject; Column: TColumnEh; AFont: TFont; var Background: TColor;
  State: TGridDrawState);
begin
  if (DBLookupComboboxEh3.ListSource.DataSet.FieldByName('Country').AsString = 'US') then
    Background := clWebPink;
end;


Attachments:
sshot-316.png
sshot-316.png [ 35.89 KiB | Viewed 4469 times ]

_________________
Best regards
EhLib Support Team
Top
 Profile  
 
PostPosted: 01 Aug 2023, 05:12 
Offline

Joined: 31 Jul 2023, 07:34
Posts: 7
Thanks for the answer, it was solved!

EhLibSupport wrote:
Hello


You can't highlight cells in dropdownbox by row position
but you can highlight by values of the current record.

Using OnDropDownBoxGetCellParams event
Like this:
Code:
procedure TfrEditControls.DBLookupComboboxEh3DropDownBoxGetCellParams(
  Sender: TObject; Column: TColumnEh; AFont: TFont; var Background: TColor;
  State: TGridDrawState);
begin
  if (DBLookupComboboxEh3.ListSource.DataSet.FieldByName('Country').AsString = 'US') then
    Background := clWebPink;
end;


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 74 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