Accessing old and new node names when editing

5 posts, 1 answers
  1. Brad
    Brad avatar
    110 posts
    Member since:
    Jun 2004

    Posted 10 Jul 2008 Link to this post

    Hi,

    I have a situation where after editing I have to fire an event containing the old and new name of the edited node so other sections of my application can update to match.  What is the best way to accomplish this?

    Regards,
    Brad
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 14 Jul 2008 Link to this post

    Hi Brad,

    I would suggest you try the following: 
       1. Subscribe to the Editing and Edited events of RadTreeView. 
       2. Save the string of the node in the Editing event handler.
       3. Save the new string in the Edited event handler.

    Edited
    event is fired after finishing node editing so in its event handler you can fire your custom event with the two string with the old and new labels of the edited node.

    Here is a sample code demonstrating my words:

      string oldNodeString; 
            string newNodeString; 
     
            void radTreeView1_Editing(object sender, CancelEventArgs e) 
            { 
                oldNodeString = this.radTreeView1.SelectedNode.Text; 
     
            } 
     
            void radTreeView1_Edited(object sender, EventArgs e) 
            { 
                newNodeString = this.radTreeView1.SelectedNode.Text; 
            } 

    I hope this helps.
    Please feel free to write me back if you need more instructions.

    Regards,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Brad
    Brad avatar
    110 posts
    Member since:
    Jun 2004

    Posted 15 Jul 2008 Link to this post

    Hi Boyko,

    In a future release would it be feasible to have an ValidatingEdit event added with the ability to cancel the edit, access to the edited RadTreeNode object and access the Text values for the old and new RadTreeNode Text properties?

    Regards,
    Brad
  5. Answer
    Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 18 Jul 2008 Link to this post

    Hello Brad,

    Thank you for the suggestion.
    In fact we are working from some time now on an editor framework, which will allow editors like these in RadGridView to be used in other controls where such functionality may be necessary (including RadTreeView).
    We are also planning a support for validation for this editor framework. Unfortunately, I cannot give you a specific time frame when you can expect this release but I believe we can safely say that Q3 2008 is a good date for that.
     
    Greetings,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 21 Mar 2011 Link to this post

    Hi Brad,

    Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.

    Kind regards,
    Stefan
    the Telerik team
Back to Top
UI for WinForms is Visual Studio 2017 Ready