Hi,
I wish to load a RadTreeView, which will populate form fields and then allow editing of these form fields. When the changes are made to the form field, we then will save the details away and re-load the tree with the new values. However I can't get the tree to appear in the same position as it was before updating, with the same node selected. How can I get to the required node and traverse to this node.
As you can see from my code I'm trying to get the text from the selected node before it is updated and then try and go back to this node, however the tree just shows the root nodes, with nothing expanded.
Thanks in advance.
if (Page.IsValid)
{
string SelectedText = RadTreeView1.SelectedNode.Text ;
RadTreeNode MyNode = RadTreeView1.SelectedNode.ParentNode;
//Get the parent node of the changed node
if (MyNode != null)
{
while (MyNode.ParentNode != null)
{
MyNode = MyNode.ParentNode;
}
}
else
{
MyNode = RadTreeView1.SelectedNode;
}
// Change the underlying code
Servizio.ServizioBase servizio = new Servizio.ServizioBase();
rms.Category category = new rms.Category();
category.Get(Convert.ToInt32(this.txt_id.Text));
category.CategoryNo = Convert.ToDecimal (txt_CategoryNo.Text);
category.save();
// Reload the grid
RadTreeView1.Nodes.Clear();
LoadRootNodes(this.RadTreeView1, TreeNodeExpandMode.ServerSideCallBack);
// find the node containing the value that was changed
RadTreeView1.Nodes.FindNodeByText(MyNode.Text).ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
RadTreeView1.Nodes.FindNodeByText(MyNode.Text).ExpandChildNodes();
I wish to load a RadTreeView, which will populate form fields and then allow editing of these form fields. When the changes are made to the form field, we then will save the details away and re-load the tree with the new values. However I can't get the tree to appear in the same position as it was before updating, with the same node selected. How can I get to the required node and traverse to this node.
As you can see from my code I'm trying to get the text from the selected node before it is updated and then try and go back to this node, however the tree just shows the root nodes, with nothing expanded.
Thanks in advance.
if (Page.IsValid)
{
string SelectedText = RadTreeView1.SelectedNode.Text ;
RadTreeNode MyNode = RadTreeView1.SelectedNode.ParentNode;
//Get the parent node of the changed node
if (MyNode != null)
{
while (MyNode.ParentNode != null)
{
MyNode = MyNode.ParentNode;
}
}
else
{
MyNode = RadTreeView1.SelectedNode;
}
// Change the underlying code
Servizio.ServizioBase servizio = new Servizio.ServizioBase();
rms.Category category = new rms.Category();
category.Get(Convert.ToInt32(this.txt_id.Text));
category.CategoryNo = Convert.ToDecimal (txt_CategoryNo.Text);
category.save();
// Reload the grid
RadTreeView1.Nodes.Clear();
LoadRootNodes(this.RadTreeView1, TreeNodeExpandMode.ServerSideCallBack);
// find the node containing the value that was changed
RadTreeView1.Nodes.FindNodeByText(MyNode.Text).ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
RadTreeView1.Nodes.FindNodeByText(MyNode.Text).ExpandChildNodes();