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

mouseover highlight

2 Answers 150 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
beavisCZ
Top achievements
Rank 1
beavisCZ asked on 06 Apr 2011, 12:27 PM
Hello, I have problem with mouseover highlighting. It works fine in new version but only when treeView is focused. When it lost focus, mouseover highlighting is disabled. I use it as sidebar menu so I need to work also if it is not focused. Is it solution to this?

2 Answers, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 11 Apr 2011, 04:50 PM
Hello beavisCZ,

Regarding your question: There is two ways to accomplish this requirement. You can create a new theme or modify an existing theme by using the Visual Style Builder tool. Find more in this documentation article.

In addition, you can use the NodeFormatting event to achieve the desired appearance in inactive state of the control:

private void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e)
{
    bool isInactive = (bool)e.NodeElement.GetValue(TreeNodeElement.IsControlInactiveProperty);
 
    if (isInactive && e.NodeElement.IsMouseOver)
    {
        e.NodeElement.BackColor = Color.Red;
        e.NodeElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
        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);
    }
}
this.radTreeView1.NodeFormatting += new Telerik.WinControls.UI.TreeNodeFormattingEventHandler(radTreeView1_NodeFormatting);

I hope this helps. 


Kind regards,
Svett
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Baki
Top achievements
Rank 1
answered on 25 Apr 2017, 08:01 AM

Hello Svett;

I want to write for this document.  It is very hepfull me 

Like I found gold :-))

Thank you so much. Have a nice day

 

Tags
Treeview
Asked by
beavisCZ
Top achievements
Rank 1
Answers by
Svett
Telerik team
Baki
Top achievements
Rank 1
Share this question
or