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

Problem in getting updated node text in code behind

4 Answers 78 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Balaji
Top achievements
Rank 1
Balaji asked on 06 May 2009, 08:42 AM

Hi Telerik,

I am using ajax rad tree view in my project. And we have the requirement of node drag & drop functionality.
And in OnClientNodeDropping event  I have written one function to change the source node text. After that I need to get the updated text at server side. But I am not getting the updated text from the source node at code behind.

Sample code:
 
<telerik:RadTreeView ID="RadTreeView1" MultipleSelect="false" OnNodeDrop="RadTreeView1_HandleDrop" EnableDragAndDropBetweenNodes="true"  EnableDragAndDrop="true" 

 OnClientNodeDropping="onNodeDropping"  EnableViewState="true" runat="server">

 </telerik:RadTreeView>
---------------------------------------------------
function onNodeDropping(sender, args)

 {

 args.get_sourceNode().set_text(args.get_sourceNode().get_text() +

"_" + args.get_sourceNode().get_value());

   }
---------------------------------------------------
In the below event I need to access the updated text. But When I try access the sourceNode.text, it is giving old text only
 
Protected Sub RadTreeView1_HandleDrop(ByVal sender As Object, ByVal e As RadTreeNodeDragDropEventArgs) 

    Dim sourceNode As RadTreeNode = e.SourceDragNode

    Dim destNode As RadTreeNode = e.DestDragNode

End Sub

Please help me to get the updated text in code behind.
 

Thanks in advance
Balaji Velasiri

 

 

4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 06 May 2009, 12:47 PM
Hello Balaji,

You should use trackChanges() and commitChanges() methods of the treeview client-side object in order to preserve changes made to the treeview at the server, this is explained here.

Best regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Balaji
Top achievements
Rank 1
answered on 07 May 2009, 08:47 AM
Hi Yana,

The example you given is very helpfull. Thanks for that.

Now, I can able to get the updated text in the code behind. But, Is there any attribute to indicate that the text is changed ?

Thanks in advance,
Balaji Velasiri



0
Yana
Telerik team
answered on 07 May 2009, 12:42 PM
Hello Balaji,

I'm glad I could help.

Please check this help article about ClientChanges property of RadTreeView.

Kind regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Balaji
Top achievements
Rank 1
answered on 14 May 2009, 12:54 PM
Hi Yana,

Sorry for the late reply. And Thanks for your reply.

It is very usefull.

Thanks,
Balaji Velasiri

Tags
TreeView
Asked by
Balaji
Top achievements
Rank 1
Answers by
Yana
Telerik team
Balaji
Top achievements
Rank 1
Share this question
or