block root item drag

2 posts, 1 answers
  1. david
    david avatar
    25 posts
    Member since:
    Oct 2008

    Posted 01 Apr 2009 Link to this post

    Is it possible to block the root item from being dragged, but the childitems
    must be draggable in a rootitem

    i have played around with the drag/dropqueries but i can't find a solution
  2. Answer
    Tihomir Petkov
    Tihomir Petkov avatar
    576 posts

    Posted 01 Apr 2009 Link to this post

    Hello David,

    You can listen for the PreviewDragStarted event and do the following:

    private void treeView_PreviewDragStarted(object sender, RadTreeViewDragEventArgs e)
        foreach (object item in e.DraggedItems)
            if ((treeView.ItemContainerGenerator.ContainerFromItem(item) as RadTreeViewItem) != null)
                e.Handled = true;

    This should achieve your purpose. Let me know if you have further questions.

    Sincerely yours,
    Tihomir Petkov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. DevCraft R3 2016 release webinar banner
Back to Top