RadDock DragDrop: How do I determine the dragged item.

3 posts, 0 answers
  1. F5F5F5
    F5F5F5 avatar
    7 posts
    Member since:
    Oct 2009

    Posted 16 Nov 2009 Link to this post

    Hi

    I have a RadDock control (named dockManager) that I am listening to the drag/drop service on, using the following code in the form's constructor:
                DragDropService dragDrop = dockManager.GetService<DragDropService>();  
                dragDrop.DragDropMode = DragDropMode.Preview;  
                dragDrop.PreviewDockPosition += new DragDropDockPositionEventHandler(dragDrop_PreviewDockPosition);  
                dragDrop.Starting += new StateServiceStartingEventHandler(dragDrop_Starting);  
                dragDrop.AllowedStates = AllowedDockState.All & ~AllowedDockState.TabbedDocument;  
     
     
    I need to determine whether I am dragging a ToolWindow, a DockTabStrip and also determine the type of toolwindow/DockTabStrip
    At the risk of asking a stupid question, how do I determine what object I am dragging in dragDrop_Starting event handler and/or dragDrop_PreviewDockPosition?

    Thanks in advance

    Alan
  2. F5F5F5
    F5F5F5 avatar
    7 posts
    Member since:
    Oct 2009

    Posted 16 Nov 2009 Link to this post

    To answer my own question:
    In the dragdrop event handlers, cast the sender to DragDropService and use dragDrop.DragDropContext.

    I was attempting to use dragDrop.Context and it was returning null.

    So, apologies for asking the initial silly question. In my defence, it is Monday morning and I don't normally wake up properly until half way through Tuesday.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Georgi
    Admin
    Georgi avatar
    296 posts

    Posted 18 Nov 2009 Link to this post

    Hi Alan,

    Thank you for sharing with the community.


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