This is a migrated thread and some comments may be shown as answers.

Changes not being saved after editing tree node.

2 Answers 89 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 12 Mar 2008, 09:47 PM
Hello,

I'm attempting to update node title changes I make to a SQL database (using server side event OnNodeEdit) but I can't seem to get it working. If my node is called "New Node" and I hit F2 or dbl-click and change it to something else, when OnNodeEdit is called, it doesn't appear to detect the change, only the original name.

Here is a sample of my code:

public void OnTitleEdited(object sender, RadTreeNodeEventArgs e)
{
    
string nodeID = e.Node.Value.ToString();
    
string nodeTitle = e.Node.Text.ToString();
    ....
    ....
}

<

telerik:RadTreeView ID="RadTreeView1" runat="server" OnNodeEdit="OnTitleEdited">
</telerik:RadTreeView>

If I edit a node, nodeID correctly returns the value, but nodeTitle returns the text prior to making the change, not after the change has been made.

How can I detect when the node text has been changed so that I can record those changes to a database?

Thanks!!

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 13 Mar 2008, 08:34 AM
Hello Paul,

This behavior is by design. e.Node.Text contains the original text whilst e.Text contains the new text. You can check our editing online example:
http://www.telerik.com/demos/aspnet/prometheus/TreeView/Examples/Functionality/NodeEditing/DefaultCS.aspx

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Paul
Top achievements
Rank 1
answered on 14 Mar 2008, 01:57 AM
Thanks :)
Tags
TreeView
Asked by
Paul
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Paul
Top achievements
Rank 1
Share this question
or