Lorenz Buchberger
Top achievements
Rank 1
Lorenz Buchberger
asked on 08 Jan 2010, 02:19 PM
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
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
5 Answers, 1 is accepted
0
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.
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.
0
Lorenz Buchberger
Top achievements
Rank 1
answered on 08 Jan 2010, 03:24 PM
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
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
0
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.
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.
0
Lorenz Buchberger
Top achievements
Rank 1
answered on 08 Jan 2010, 05:12 PM
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
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
0
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.
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.