I have a TreeView where all the nodes expand mode is set to ServerSideCallback. When new nodes are added their expand mode is also set to ServerSideCallback.
In my situation I need to expand the selected node based on the result of a partial postback.
On the server side I have a handler for the NodeExpand event.
protected void rtvMain_NodeExpand(object sender, RadTreeNodeEventArgs e)
{
// Logic/Breakpoint here
}
And I have a javascript function that looks like this:
function ExpandSelectedNode() {
var tree = $find("<%= rtvMain.ClientID %>");
if (tree.get_selectedNode() != null) {
var selectedNode = tree.get_selectedNode();
selectedNode.expand();
}
}
After the ajax/partial postback I call the javascript function by registering a startup script. I use ScriptManager.RegisterStartupScript and call my javascript function "ExpandSelectedNode()"
In the treeview I see the default loading animation appear on the selected node, which would indicated it is performing an asynchronous operation. The problem is that the server side handler "rtvMain_NodeExpand()" never gets called.
However, when I click the [+] next to the treeview item the postback is fired and it calls "rtvMain_NodeExpand()" as it should. This tells me that my treeview and its nodes are configured properly. So I have to assume there is a bug in the RadTreeNode.expand() client side method that is preventing it from firing the server side callback.