This is a migrated thread and some comments may be shown as answers.

Change border in MouseEnter Event

5 Answers 67 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Faustino
Top achievements
Rank 1
Faustino asked on 02 Nov 2019, 07:25 PM

How can I change the right edge of a node in the MouseEnter event, change border width and color

Thanks for your help

5 Answers, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 04 Nov 2019, 02:16 PM

Hello Faustino,

According to your brief description, I suppose that you want to change the right border color and width of the TreeNodeElement for the specified state. I can suggest using the NodeFormatting event and the SetThemeValueOverride method as shown below:

private void RadTreeView1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
{
      e.NodeElement.SetThemeValueOverride(LightVisualElement.BorderRightColorProperty, Color.Red, "FullRowSelect.MouseOver");
      e.NodeElement.SetThemeValueOverride(LightVisualElement.BorderRightWidthProperty, 5f, "FullRowSelect.MouseOver");
}

The achieved result is demonstrated in the attached gif file.

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Nadya
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Faustino
Top achievements
Rank 1
answered on 04 Nov 2019, 05:10 PM

It's great! is what i wanted

thanks!!!!!

0
Faustino
Top achievements
Rank 1
answered on 04 Nov 2019, 11:04 PM
One question does not work when the treeview have a theme??
0
Nadya | Tech Support Engineer
Telerik team
answered on 05 Nov 2019, 02:58 PM

Hello Faustino,

I am glad that the suggested solution works for you.

Note that every theme has different styles and settings. Could you please specify which theme you use in your project? I can suggest using the Visual Style Builder where you can modify the theme and change the styles of each specific state. Here are the steps you need to take to achieve this:

1. Extract the predefined themes, which will allow you to edit the crystal theme: Loading Predefined Themes
2. Change the BorderRightColor and BorderRightWidth properties in the theme (see attached).
3. Save and use the new theme in your application: Using custom themes

I am looking forward to your reply.

Regards,
Nadya
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Faustino
Top achievements
Rank 1
answered on 06 Nov 2019, 04:18 PM
Thank you! He helped me a lot and I could do it with his example!
Tags
Treeview
Asked by
Faustino
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Faustino
Top achievements
Rank 1
Share this question
or