Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

imagelist

I am trying to set the images  property for fcDBTreeview at run time. I have
two
different image list that I use depending upon the node level. These
properties are set in the
an oncalcnodes event.  When I run this code wierd things happen: You can not
navigate the tree.The
queries do not run. Should I set this property else where in the code
besides the oncal procedure? Or do I need to set additional properties?
Please advise.
procedure TForm1.fcDBTreeView1CalcNodeAttributes(
  TreeView: TfcDBCustomTreeView; Node: TfcDBTreeNode);
begin

        if node.level = 0
             fcDBTreeView1.Images := imagelist1;
       else
      if node.level = 1
           fcDBTreeView1.Images := imagelist2;
     end;


0
khbryant
Asked:
khbryant
1 Solution
 
meirchenCommented:
If you place the images in the same imagelist, it will possible to select the imageindex.  I don't know if it is possible to use seperate lists
0
 
fvaCommented:
First of all, you might want to go in CommunitySupport topic and request that your other question to be deleted and your points returned. It's a duplicate. Alternatively you can delete it yourself, but it's a little dirtier.

About your question:
meirchen seems right, you should use one single image list.
The cause is probably in the implementation of the treeview control, which is merely a wrapper over Windows's standard control. The handler you quoted gets probably called as response to a callback from Windows itself, and at that time it might be not possible to change the image list (operation that is still a WinAPI tree control message itself).

Just my opinion,
F.
0
 
Russell LibbySoftware Engineer, Advisory Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept meirchen's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now