Hello,
I have a control that loads a RadTreeView using an object as the source and performing on-demand loading of child nodes via the OnNodeExpand event. I also use a RadWindow to allow users to edit the tree nodes. When the user saves their changes on the RadWindow, it fires an ajax event using javascript which then uses an ajax request to update the node in the tree. This is working very nicely.
However, when the user finishes editing and closes the RadWindow the RadTree no longer functions properly. The OnNodeExpand event is no longer firing when trying to expand a node and the OnClientMouseOver I was using to display tooltips is not effective below the first level of nodes. I've tried adding the NodeExpand event handler back in after the update just in case it's getting lost somewhere, but this doesn't seem to work.
Any ideas what I'm doing wrong?
Thanks,
Courtney
Here's my ajax request code
I have a control that loads a RadTreeView using an object as the source and performing on-demand loading of child nodes via the OnNodeExpand event. I also use a RadWindow to allow users to edit the tree nodes. When the user saves their changes on the RadWindow, it fires an ajax event using javascript which then uses an ajax request to update the node in the tree. This is working very nicely.
However, when the user finishes editing and closes the RadWindow the RadTree no longer functions properly. The OnNodeExpand event is no longer firing when trying to expand a node and the OnClientMouseOver I was using to display tooltips is not effective below the first level of nodes. I've tried adding the NodeExpand event handler back in after the update just in case it's getting lost somewhere, but this doesn't seem to work.
Any ideas what I'm doing wrong?
Thanks,
Courtney
Here's my ajax request code
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
string[] values = e.Argument.Split(new[] { "|" }, 2, StringSplitOptions.None);
string nodeId = values[0];
string nodeText = values[1];
foreach (RadTreeNode node in GroupTree.Nodes)
{
if (UpdateNode(node, nodeId, nodeText))
break;
}
GroupTree.NodeExpand += (GroupTreeOnNodeExpand);
}
private static bool UpdateNode(RadTreeNode node, string nodeId, string nodeText)
{
if (node.Attributes["id"] == nodeId)
{
node.Text = nodeText;
return true;
}
foreach (RadTreeNode childNode in node.Nodes)
{
if (UpdateNode(childNode, nodeId, nodeText))
return true;
}
return false;
}