This is a migrated thread and some comments may be shown as answers.

dragDrop:RadDragAndDropManager.AllowDrop="True" in C#

2 Answers 92 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 03 Feb 2011, 06:13 AM
Hi:

How do I do the following in C# code?

<Canvas x:Name="Page2_Canvas" Background="White" dragDrop:RadDragAndDropManager.AllowDrop="True" Width="600" Height="400"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MouseLeftButtonDown="Either_Canvas_MouseLeftButtonDown"
MouseLeftButtonUp="WireframeElementMouseLeftButtonUp" MouseMove="WireframeElementMouseMove" />

The C# code is below, but how do I accomplish the dragDrop:RadDragAndDropManager.AllowDrop  setting?

Canvas c = new Canvas()
{
    Background = new SolidColorBrush( Colors.White ),
    Height = document.HeightInPixels,
    Width = document.WidthInPixels,
    HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
    VerticalAlignment = System.Windows.VerticalAlignment.Stretch,
};
c.MouseLeftButtonDown += new MouseButtonEventHandler( Either_Canvas_MouseLeftButtonDown );
c.MouseLeftButtonUp += new MouseButtonEventHandler( WireframeElementMouseLeftButtonUp );
c.MouseMove += new MouseEventHandler( WireframeElementMouseMove );
 
Thanks,

Terry

2 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 03 Feb 2011, 08:04 AM
Hello Terry,

You should use the SetAllowDrag static method of RadDragAndDropMAnager.

RadDragAndDropManager.SetAllowDrag(c, true);


All the best,
Milan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Terry
Top achievements
Rank 1
answered on 03 Feb 2011, 05:10 PM
Thanks, Milan, for your quick response!
Tags
DragAndDrop
Asked by
Terry
Top achievements
Rank 1
Answers by
Milan
Telerik team
Terry
Top achievements
Rank 1
Share this question
or