I've found out (the hard way) that NodeClick event is not raised when the page containing the treeview has EnableViewState = false.
Is this a bug? I think it migth be since other events like NodeDataBound and ContextMenuItemClick are raise normally.
5 Answers, 1 is accepted
Thanks for your example, it surely works but I when I link the tree to an AccessDataSource (try tree.mdb from the examples) that the problem appears. I will gladly upload an example app showing this if needed.
Indeed when binding to declarative sources RadTreeView will not raise the NodeClick event. This occurs due to the way declarative databinding works. It occurs later than the moment when postback events are processed and as a result the treeview is still empty. To force earlier databinding you should call the DataBind method of the treeview during the PageLoad event:
protected void Page_Load(object sender, EventArgs e)
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I have the same problem . i would like to put EnableViewState=false to my RadTreeView but the onNodeEdit event does not raised.
My RadTreeView is loaded manually on Server side during Page_Load.
When a node has been edited, I would like to use the onNodeEdit event , to update some data and then load the RadTreeView . Here is a sample code to explain my scenario:
<telerik:RadTreeView ID="TreeViewFolder" runat="server" EnableViewState="false" Skin="Outlook" AllowNodeEditing="true" OnNodeEdit="TreeViewFolder_NodeEdit">
Code-Behind (VB.NET) :
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim nodeMailBox As RadTreeNode
Protected Sub TreeViewFolder_NodeEdit(ByVal sender As Object, ByVal e As RadTreeNodeEditEventArgs)
Dim nodeEdited As RadTreeNode = e.Node
Dim newText As String = e.Text
This code runs fine if EnableViewState=true (except the RadTreeView is duplicated)
Thanks for your help
You should populate the treeview on every page load because you have disabled the viewstate. Just always call the TreeViewBuild method in Page_Load.
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.