Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 18:54

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 10 Feb 2022, 10:03 
Offline

Joined: 30 Oct 2014, 07:47
Posts: 7
how to use icon to show the status of the node in the tree that is expanded or collapsed .. or in other word i want when i expand the node the icon of the tree changed to opened book icon and when the node is collapsed the icon changed to closed book icon as in the attached image .


Attachments:
treeicon.png
treeicon.png [ 3.15 KiB | Viewed 640 times ]
Top
 Profile  
 
PostPosted: 11 Feb 2022, 05:03 
Offline

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

You can use TColumnEh.ImageList to set ImageList for column and use OnGetCellParams to set ImageIndex
Use MemTableEh1.RecView.NodeExpanded property to check Expanded state.

Code:
procedure TForm1.FormCreate(Sender: TObject);
begin
  DBGridEh1.Columns[0].ImageList := ImageList16;
  DBGridEh1.Columns[0].OnGetCellParams := ColCellParams;
  DBGridEh1.Columns[0].ShowImageAndText := True;
end;

procedure TForm1.ColCellParams(Sender: TObject; EditMode: Boolean;
  Params: TColCellParamsEh);
begin
  if (MemTableEh1.RecView.NodeExpanded) then
    Params.ImageIndex := 1
  else
    Params.ImageIndex := 0;
end;

_________________
Best regards
EhLib Support Team


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 9 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