Change Toggle Icon

2 posts, 0 answers
  1. Tommy Walsh
    Tommy Walsh avatar
    7 posts
    Member since:
    Sep 2008

    Posted 13 Apr 2009 Link to this post

    I'd like to change (or possibly remove) the toggle icon (+/- next to the text) on one (but not all) of my TreeViews. Is this possible?

    Thanks,

    Tommy

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 13 Apr 2009 Link to this post

    Hi Tommy Walsh,

    You can achieve this using JavaScript. Here is some sample code:
           
    <script type="text/javascript">
                function treeViewLoaded(sender, args)
                {
                    var node = sender.findNodeByText("Root Node");
                    node.get_toggleElement().style.display = "none";
                }
    </script>
            <telerik:RadTreeView runat="server" ID="RadTreeView1" OnClientLoad="treeViewLoaded">
                <Nodes>
                    <telerik:RadTreeNode Text="Root Node" Expanded="true">
                        <Nodes>
                            <telerik:RadTreeNode Text="Child Node 1" />
                            <telerik:RadTreeNode Text="Child Node 2" />
                        </Nodes>
                    </telerik:RadTreeNode>
                </Nodes>
            </telerik:RadTreeView>

    Greetings,
    Albert
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top