Dropping on TreeView with validation

2 posts, 0 answers
  1. Voltz
    Voltz avatar
    17 posts
    Member since:
    Aug 2011

    Posted 13 Sep 2011 Link to this post

    we're trying to use drag and drop on a listbox and 2 tree views.

    the premise is that listbox can drop into TreeView A but cannot drop into TreeViewB
    TreeViewA has a 2 level hierarchy
    TreeView A can drop the parent (1st level nodes) node (using say CustomerViewModel) into TreeViewB only
    TreeView A can drop the child nodes (say for example ProductViewModel) back into the listbox only

    TreeViewB  also has a 2 level hierarchy
    TreeViewB cannot drop its parent node (1st level nodes which is of GroupViewModel) anywhere
    TreeView can drop its child nodes (which is CustomerViewModel) back into TreeViewA

    we tried adding a handler into the TreeView, but only AddDropInfoHandler is working. AddDropQueryHandler doesn't pass into the defined handler...
  2. Tsvyatko
    Tsvyatko avatar
    832 posts

    Posted 15 Sep 2011 Link to this post

    Hi Voltz,

     You can use DropQuery event to achieve this. Since TreeView handles this event one need to attach to it using the following code:

    using Telerik.Windows;
    treeB.AddHandler(RadDragAndDropManager.DropQueryEvent,new EventHandler<DragDropQueryEventArgs>(OnDropQuery),true);

    Let us know if you have any further issues.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft R3 2016 release webinar banner
Back to Top