Hey,
I can't edit a node after it is created (or copy).
My Treeview is in an ascx file...
For exemple :
and :
(in debug nodeValue = "ADVANTECH/Automation Controllers")
I don't know what to try to edit the new node :-(
Enclosed : just after copy a node
I can't edit a node after it is created (or copy).
My Treeview is in an ascx file...
For exemple :
protected void RadTreeView1_ContextMenuItemClick(object sender, RadTreeViewContextMenuEventArgs e)
{
RadTreeNode clickedNode = e.Node;
switch (e.MenuItem.Value)
{
case "Copy":
RadTreeNode clonedNode = clickedNode.Clone();
clonedNode.Text = string.Format("Copy of {0}", clickedNode.Text);
clickedNode.InsertAfter(clonedNode);
//set node's value so we can find it in startNodeInEditMode
clonedNode.Value = clonedNode.GetFullPath("/");
clonedNode.Selected = true;
startNodeInEditMode(clonedNode.Text);
break;
}
}
and :
private void startNodeInEditMode(string nodeValue)
{
//find the node by its Value and edit it when page loads
string js = "Sys.Application.add_load(editNode); function editNode(){ ";
js += "var tree = $find(\"" + RadTreeView1.ClientID + "\"); ";
js += "var node = tree.findNodeByValue('" + nodeValue + "');";
js += "if (node) node.startEdit();";
js += "Sys.Application.remove_load(editNode);};";
RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "nodeEdit", js, true);
}
(in debug nodeValue = "ADVANTECH/Automation Controllers")
I don't know what to try to edit the new node :-(
Enclosed : just after copy a node