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

RadTreeView: editing dropped items

1 Answer 42 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 11 Jun 2013, 02:41 PM
I am attempting to put a treeview node into edit mode after it is dragged and dropped to a new location within the same treeview.  I am using the following code in the DragEnded event handler to achieve this:

RadTreeViewItem item = e.DraggedItems[0] as RadTreeViewItem;
item.IsInEditMode = true;

However I am experiencing unexpected functionality.  Instead of the node being put into edit mode the display text is cleared and the node is not editable.  I have been able to get the edit functionality to work in other instances but not in this case.  Is there an issue with putting a node into edit mode from the DragEnded event handler?

Thanks,

Daniel A

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 14 Jun 2013, 08:08 AM
Hi Daniel,

I am not sure that I understand your scenario. However, such issue may occur if you try to set the IsInEditMode property of the RadTreeViewItem to True when the IsEditable property of the RadTreeView control is set to False. Have in mind that False is its default value. Can you please make sure that you set the IsEditable property to True before dropping an item.

Furthermore, you will have to define an IetmEditTemplate. In that template you can define a TextBlock with Text property bound in TwoWay mode to property defined in your View-Model, so that changes triggered from the UI are reflected into your View-Model.

I hope this information will help you.

Regards,
Pavel R. Pavlov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeView
Asked by
Daniel
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or