how can I force the repainting of a node, after I change its Override.NodeAppearance.Image property?
Setting this property in the InitializeDataNodeEvent works. After populating the tree, our users have the possibility to change the icon, but the tree shows the old one.Tree.Refresh() does not help.
Hi,
If you are setting the Image property on the appearance, then the tree should update the display automatically. You don't have to do anything extra in order to refresh the nodes to display the image.
If simply setting the property isn't working, then something is wrong. What version of the tree are you using? And what Override are you using?
@Georgi:thank you, that is what I want to do, but it doesn't work for me.
@Mike:I use the Version 12.2I have tried to set node.Override.NodeAppearance.Image = newicon; and I tried to set node.LeftImages.Add(newicon);
Both of them works in the InitializeDataNodeEvent.None of them works after the tree is rendered.
In the debugger I can see, that the properties are setted well, but nothing happens, the old icon is still displayed.Does NodeAppearance.Image and LeftImages work with Databound tree?I am using NodeStyle.Standard.
Are you saying that you are not seeing any image at all? Your original post says that you still see the old image, but if that's the case, then I am confused.
If the tree is bound, then by the default, the tree will show in grid style, and in that style, node will not display an image since they are displaying cells. If you want to display an image in a grid-style node, you need to put the image into a cell, so you probably need to create an extra column.
If you are saying that you are seeing an image in a grid-style tree, then I don't understand how that can be, unless the image is in a cell, in which case, you need to change the image in the cell, not using the Override.
Sorry for the confusing, it was my fault.
For testing purposes I had two instances of my tree, and I set the icon in the hidden one. :-(It works of course.