DragDrop with Buttons and WrapPanels

6 posts, 0 answers
  1. Lorenz Buchberger
    Lorenz Buchberger avatar
    10 posts
    Member since:
    Dec 2009

    Posted 08 Jan 2010 Link to this post

    Hi,

    I would like to implement Drag & drop with Buttons on Wrappanels. The buttons are generated by code.

    May anyone can show me the way ? I'm totally lost...

    Cheers

    Lorenz
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 08 Jan 2010 Link to this post

    Hello Lorenz Buchberger,

    Please check our online examples. I wonder what problems you are facing? Please let us know so we can improve the API or the samples. Thanks!

    Sincerely yours,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Lorenz Buchberger
    Lorenz Buchberger avatar
    10 posts
    Member since:
    Dec 2009

    Posted 08 Jan 2010 Link to this post

    Hi,
    You have wonderful examples, but sometimes they are a little bit too complex. The DragAndDrop example is only with listboxes, not with normal panels, and the items are listitems - not nomal controls. I didn't find a sample with normal controls to drag.
     
    I dont know how to set the dragDrop:RadDragAndDropManager.AllowDrag="True" in the dynamically generated buttons.

    kind regards,

    Lorenz
  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 08 Jan 2010 Link to this post

    Hello Lorenz Buchberger,

    Thank you for your feedback! You are correct that the Drag and Drop manager examples are somewhat complex. We will address that. We are also working on much improved help articles which will be ready withing the next one month.

    To dynamicaly set the drag user the following syntax:
    RadDragAndDropManager.SetAllowDrag(element, true);

    Please check this blog post for a more simple examples with project sample code:
    http://blogs.telerik.com/evanhutnick/posts/09-08-18/raddrag_drop_with_a_canvas_twist.aspx

    Please let us know  how it goes.

    Best wishes,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Lorenz Buchberger
    Lorenz Buchberger avatar
    10 posts
    Member since:
    Dec 2009

    Posted 08 Jan 2010 Link to this post

    Thanks for the link,
    I tried some things out and now the things are going better, but I have two questions:

    1) It's not possible dropping sonething in a wrappanel which is in a Raddocking structure ?
    2) I would like to have a picture of the dragged object as dragicon: How do I do that ?

    Kind regards

    Lorenz
  7. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 12 Jan 2010 Link to this post

    Hello Lorenz Buchberger,

    Dropping in a panel should be possible. Sometimes panels do not receive mouse events because they do not have a background property set, try to have a recognizable background while debugging and at least "Transparent" otherwise.

    Also please make sure that the panel is stretched, this should be visible once you set a background.

    As for your second question: The e.Options.DragCue of the DragDrop can be anything, including an Image control whose Source property is set to a RenderTargetBitmap. Then you can use the Render() method on the RenderTargetBitmap to render an arbitrary control there.

    You may see other solutions that are using a VisualBrush but in WPF anything that you assign as its source will never be garbage collected (i.e. it will result in a memory leak).

    Sincerely yours,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for WPF is Visual Studio 2017 Ready