Drag and Drop inside StackPanel

2 posts, 0 answers
  1. al
    al avatar
    29 posts
    Member since:
    Dec 2008

    Posted 25 Mar 2009 Link to this post

    Hi everyone!

    Is it posible to make drag and drop inside a stack pannel. What i m trying to de here is that, i want to arrange the items inside the stack panel. I have created a user control and i added it inside the stack panel.

  2. Miroslav
    Miroslav avatar
    922 posts

    Posted 25 Mar 2009 Link to this post

    Hi Al,

    I answered to your ticket, but I am posting my reply here as well, you can continue either thread:

    It is possible to drag items within a StackPanel, in fact I created an example which shows how you can rearrange items in a ListBox (which uses a StackPanel) and drag them to and from a WrapPanel.

    You can find the example here:


    And the example with the ListBox on its own here:


    If you like to have richer user experience with the dragging cues available to the users, please consider using an ItemsControl instead of a stack. This way you will be able to also bind it and it has a ControlTemplate which can be modified to suit different needs (as with the DragDrop in this case). Visually the ItemsControl and the StackPanel will look identical. If you want you can convert the ListBox from the example to an ItemsControl by changing its name and modifying the ControlTemplate a bit.

    I will be happy to help you with any questions you have,

    Sincerely yours,
    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