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

Hide toggle image button of Root node on page load

3 Answers 94 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
JM
Top achievements
Rank 1
JM asked on 06 Aug 2008, 01:25 PM
I'm using RAD Treeview Q2 2008.  Please give me an idea or better yet sample code on how to hide the toggle image button of the root node on page load. I tried doing the suggestions in the following thread

http://www.telerik.com/community/forums/thread/b311D-bebhgk.aspx

but wasn't able to accomplish what I want as $find("<%=RadTreeView1.ClientID%>") is always null on page load, either using ScriptManager.RegisterStartupScript() or by including the script on client-side page. I'm generating the nodes server-side with the root node automatically expand and disabled, thus end-users cannot toggle the node.

Thanks in advance.

JM

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 06 Aug 2008, 01:32 PM
Hi sparton,

You can use the OnClientLoad event of RadTreeView and use the approach described in the other forum thread. The treeview client-side object will be initialized during OnClientLoad.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
JM
Top achievements
Rank 1
answered on 06 Aug 2008, 02:05 PM
Thanks but I tried doing that a while ago and for some reason the OnClientLoad event wasn't called on page load. Is there another way to do this?
0
Atanas Korchev
Telerik team
answered on 06 Aug 2008, 03:20 PM
Hello sparton,

The OnClientLoad event should be fired on page load provided you are using the latest official release. You can check our online demo.

The other option is to use the pageLoad javascript function which is part of the ASP.NET Ajax client-side lifecycle:
<script type="text/javascript">
function pageLoad()
{
 //Your code here.
}
</script>
Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
JM
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
JM
Top achievements
Rank 1
Share this question
or