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

Have a control(div) inside the treeview template

1 Answer 53 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
mirang
Top achievements
Rank 1
mirang asked on 15 May 2012, 02:07 AM
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>

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 17 May 2012, 12:20 PM
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.
Tags
TreeView
Asked by
mirang
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or