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

Accessing old and new node names when editing

4 Answers 91 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 2
Brad asked on 11 Jul 2008, 03:51 AM
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

4 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 14 Jul 2008, 03:45 PM
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
0
Brad
Top achievements
Rank 2
answered on 15 Jul 2008, 10:25 PM
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
0
Accepted
Jordan
Telerik team
answered on 18 Jul 2008, 10:17 AM
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
0
Stefan
Telerik team
answered on 21 Mar 2011, 10:19 AM
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
Tags
Treeview
Asked by
Brad
Top achievements
Rank 2
Answers by
Boyko Markov
Telerik team
Brad
Top achievements
Rank 2
Jordan
Telerik team
Stefan
Telerik team
Share this question
or