Is there a way to Bold or change the style of the activenode?
I have been looking at the OnActiveNodeChanged, but I don't see where I can update the style.
thanks
I was able to do the following for bolding the activenode, but how can I change the image or icon
e.NewActiveTreeNode.Control.FontWeight =FontWeights.ExtraBold;
Hello,
Thank you for your post. I have been looking into your question and what I can suggest is creating a style for the XamDataTreeNodeControl and add a Trigger that checks whether the node is active and sets the FontWeight property. Also, you can create a DataTempalte with a TextBlock for the ItemTempalte of the NodeLayout and use the same approach there (add a Trigger and set the FontWeight of the TextBlock). I have created sample application for you that shows how you can implement both of the approaches.
Regarding the approach that you have described, using the ActiveNodeChanged event, using it might cause some issues related to the virtualization of the XamDataTree’s node controls. Since the node controls are virtualized, if you click on the first node to activate it and bold it, and the scroll so the first node is not in view, the node control of the first node will be used for some of the nodes that are coming into view and they will appear bold, even if they are not selected, which is the reason for suggesting to use bindings. When you use styles or templates and use triggers that are bound to a property of an object that is not virtualized, you will avoid such issues and when the same node control is used for different node, the data context of the node control will change and this will re-trigger the setter and you will have the correct appearance. I have created a video that show the issue that will appear when setting the XamDataTreeNodeControl properties in code.
Regarding the collapsed and expanded icon templates, it seems to be the same question as the one that you have posted here: http://ko.infragistics.com/community/forums/p/61653/423715.aspx#423715, to which Stefan already replied.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir, MCPD
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
I am just checking if you require any further assistance on the matter.