Problem in getting updated node text in code behind

5 posts, 0 answers
  1. Balaji
    Balaji avatar
    30 posts
    Member since:
    Mar 2008

    Posted 06 May 2009 Link to this post

    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

     

     

  2. Yana
    Admin
    Yana avatar
    4781 posts

    Posted 06 May 2009 Link to this post

    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.
  3. Balaji
    Balaji avatar
    30 posts
    Member since:
    Mar 2008

    Posted 07 May 2009 Link to this post

    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



  4. Yana
    Admin
    Yana avatar
    4781 posts

    Posted 07 May 2009 Link to this post

    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.
  5. Balaji
    Balaji avatar
    30 posts
    Member since:
    Mar 2008

    Posted 14 May 2009 Link to this post

    Hi Yana,

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

    It is very usefull.

    Thanks,
    Balaji Velasiri

Back to Top