RadTreeView: editing dropped items

2 posts, 0 answers
  1. Daniel
    Daniel avatar
    8 posts
    Member since:
    May 2012

    Posted 11 Jun 2013 Link to this post

    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?


    Daniel A
  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1165 posts

    Posted 14 Jun 2013 Link to this post

    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.

    Pavel R. Pavlov

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft R3 2016 release webinar banner
Back to Top