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

3 posts, 0 answers
  1. Terry
    Terry avatar
    157 posts
    Member since:
    Jul 2009

    Posted 03 Feb 2011 Link to this post

    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. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 03 Feb 2011 Link to this post

    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>>
  3. DevCraft banner
  4. Terry
    Terry avatar
    157 posts
    Member since:
    Jul 2009

    Posted 03 Feb 2011 Link to this post

    Thanks, Milan, for your quick response!
Back to Top