Thanks
Sunil
If
e.Node.Text = GroupNameRadTextBox.Text.Trim()
Then
e.NodeElement.BackColor = Color.LightYellow
e.NodeElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
e.NodeElement.ForeColor = Color.Red
e.NodeElement.DrawFill =
True
Else
e.NodeElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local)
e.NodeElement.ResetValue(LightVisualElement.DrawFillProperty, Telerik.WinControls.ValueResetFlags.Local)
e.NodeElement.ResetValue(LightVisualElement.GradientStyleProperty, Telerik.WinControls.ValueResetFlags.Local)
e.NodeElement.ResetValue(LightVisualElement.ForeColorProperty, Telerik.WinControls.ValueResetFlags.Local)
End
If
6 Answers, 1 is accepted

I am glad to hear that you have addressed the issue on your own. You can use the ForeColor property of the logical RadTreeNode instance. Even more, you can use it outside the NodeFormatting event. If you are setting the ForeColor property of the visual TreeNodeElement instance, you should do it only in the NodeFormatting event.
Regards,Svett
the Telerik team

It doesn't work in NodeFormatting event when I set forecolor of TreeNodeElement. This seems to be an issue. That was what I tried before posting a message here.
Thanks
Sunil
I did not notice the mode you are using the RadTreeView in. If you are using it in full row select mode, then you should set the properties of TreeNodeElement. When you are not using full row select mode, you should use the TreeNodeContentElement by accessing the ContentElement property of the node visual element:
void
radTreeView1_NodeFormatting(
object
sender, TreeNodeFormattingEventArgs e)
{
e.NodeElement.ContentElement.BackColor = Color.Red;
}
Greetings,
Svett
the Telerik team

I mean I need to know rocket science to do that. How would a developer ever think of using ContentElement?
NodeElement is quite an intuitive way of changing appearance, but for some reason, Telerik adds 'unnecessary' complexity with each new version.
I do not like the model you have described. I have to wait for a day or 7 days to know that some mysterious object called ContentElement needs to be used to change appearance of a tree node. Not at all productive from a developers point of view, in my opinion.
Thanks
Sunil
Thank you for your feedback regarding usability of our framework.
When we plan and develop a feature or a whole control we take into consideration several key points such as performance, the features that our customers demand and of course ease of use. We are trying to cover the features that a control offers with flexible and powerful API, balancing between user-friendly API and performance. Still, there are situations where we can't satisfy both and therefore the API of RadTreeView is as it is. This allows RadTreeView to offer the features that you, our customers have requested, without affecting the performance.
I hope that this clarifies the case. If you have additional questions, feel free to write back.
Best wishes,
Svett
the Telerik team