mouseover highlight

2 posts, 0 answers
  1. beavisCZ
    beavisCZ avatar
    21 posts
    Member since:
    May 2007

    Posted 06 Apr 2011 Link to this post

    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. Svett
    Admin
    Svett avatar
    728 posts

    Posted 11 Apr 2011 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top