back color when node disabled

3 posts, 0 answers
  1. Shirya
    Shirya avatar
    40 posts
    Member since:
    Sep 2008

    Posted 05 Mar 2009 Link to this post

    Hello,
    When I create a TreeView via code and  a node is disabled, his backColor become "gray-gradient".
    But if the Treeview is created in design, there is not backColor .
    How can i have the same "Disabled Style" as if i create my treeView via Design ?
    Thank you
  2. Shirya
    Shirya avatar
    40 posts
    Member since:
    Sep 2008

    Posted 10 Mar 2009 Link to this post

    there is no way?
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 10 Mar 2009 Link to this post

    Hi Shirya,

    Thank you for writing.
    Please excuse us for the late reply. We have been really busy lately with the preparations for the new release Q1 2009.

    As to your question, you experience the described behavior because when you create your RadTreeView through code, it has no theme set. You can address your issue by setting the ThemeName property of your tree view to "ControlDefault" after you add it to your controls collection.
    RadTreeView tree2 = new RadTreeView();  
                tree2.Nodes.Add(new RadTreeNode());  
                tree2.Nodes.Add(new RadTreeNode());  
                tree2.Nodes.Add(new RadTreeNode());  
                tree2.Nodes.Add(new RadTreeNode());  
                tree2.Nodes.Add(new RadTreeNode());  
                tree2.Enabled = false;  
     
                this.Controls.Add(tree2);  
                tree2.ThemeName = "ControlDefault"

    Please write back if you need further assistance.

    Best wishes,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top