The scenario :
My customer wants the tree node text to be edited after some button the page clicked. The scenario is as follows:
1 button clicked
2 selected node in tree became editable (displayed inside textbox)
3 after losing focus the changes are saved
My Code :
When i populate the tree nodes i set the
My customer wants the tree node text to be edited after some button the page clicked. The scenario is as follows:
1 button clicked
2 selected node in tree became editable (displayed inside textbox)
3 after losing focus the changes are saved
My Code :
When i populate the tree nodes i set the
AllowEdit property to false - to prevent node became editable when clicked.
in the button_Click eventhandler i put call to
startNodeInEditMode function
as in the following code:
public
void
startNodeInEditMode(
string
nodeValue)
{
string
js =
"Sys.Application.add_load(editNode); function editNode(){ "
;
js +=
"var tree = $find(\""
+ RadTreeView1.ClientID +
"\");"
;
js +=
"var node = tree.get_selectedNode();"
;
js +=
"if (node) node.startEdit();"
;
js +=
"Sys.Application.remove_load(editNode);};"
;
RadScriptManager.RegisterStartupScript(Page, Page.GetType(),
"nodeEdit"
, js,
true
);
}
protected
void
RadTreeView1_NodeEdit(
object
sender, RadTreeNodeEditEventArgs e)
{
e.Node.Text = e.Text;
The Problem :
The changed text of the node returns back to old version of text (the changes suddenly disappear after few seconds and old text appear)
Althougt i see that changes are saved in db inside the RadTreeView1_NodeEdit function.
Please help