Have a control(div) inside the treeview template

2 posts, 0 answers
  1. mirang
    mirang avatar
    115 posts
    Member since:
    Aug 2010

    Posted 14 May 2012 Link to this post

    Is it possible to get a div inside the treeview control such that i get the entire tree and below that i get a link. I want it in the same control so that if there are scrollbars for the treeview the link should scroll along with the treeview, like a custom temlated control. so its structure should be something like : 
    <div id="myRadTree">
    <ul class="rtUL">
            <li class="rtLI rtFirst">
                <div class="rtTop">
                    <span class="rtSp"></span>
                    <img class="rtImg" alt="" src="Images/Add2Favs_16.png"><span class="rtIn" title="mev3\10000 Folders">10000
                        Folders (mev3)</span></div>
            </li>
            <li class="rtLI rtLast">
                <div class="rtBot">
                    <span class="rtSp"></span>
                    <img class="rtImg" alt="" src="Images/Add2Favs_16.png"><span class="rtIn" title="mev3\Deleted Items">Deleted
                        Items (mev3)</span></div>
            </li>
    </ul>
    <div>
    <a href="">Link here</a>
    </div>
    </div>
  2. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 17 May 2012 Link to this post

    Hello Mirang,

     
    Here is one way to achieve such functionality by handling the onClientLoad of RadTreeView:

    function OnClientLoad(sender) {
                    var tree = sender;
                    var div = document.createElement("DIV");
                    var a = document.createElement('a');
                    a.title = "telerik";
                    a.innerHTML = a.title;
                    a.href = "http://www.telerik.com";
                    tree.get_element().appendChild(div);
                    div.appendChild(a);
                    
                }

    Hope this will be helpful.

    All the best,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top