Catch DragAndDrop Event from telerikScheduler:AppointmentDialogWindow

2 posts, 1 answers
  1. Roquier Michael
    Roquier Michael avatar
    4 posts
    Member since:
    Sep 2009

    Posted 12 Oct 2009 Link to this post

    Hi,

    I wanted to manage 2 listBoxs with drag and drop functionnality in a AppointmentDialogWindow of sheduler.

     

    So,i designed in a  ControlTemplate of AppointmentDialogWindow 2 listBox with drag and drop functionnality.

    In the code behind, I declare  :

     
    RadDragAndDropManager.AddDragQueryHandler(this,OnDragQuery);  
    RadDragAndDropManager.AddDragInfoHandler(this, OnDragInfo);  
    RadDragAndDropManager.AddDropQueryHandler(this, OnDropQuery);  
    RadDragAndDropManager.AddDropInfoHandler(this, OnDropInfo);  
     

    where “this” is the form contain the radSheduler.

    The problem is the methodes “OnDragQuery”, “OnDragInfo”, “OnDropQuery” and “OnDropInfo” aren’t actived when I drag and drop a item.

     

    How can i catch  eventDragAndDrop’s listBox  designed in  AppointmentDialogWindow  of a sheduler from the sheduler’s form?

     
    Thanks for your help.

  2. Answer
    Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 15 Oct 2009 Link to this post

    Hi Roquier Michael,

    Thank you for your interest in our controls.

    To work everything as expected you have to find the instance of the dialog window and hook the events to this instance instead of the this object.

    To do this I suggest you hook on the scheduler's LayoutUpdated event and execute the following code:
    void scheduler_LayoutUpdated(object sender, EventArgs e)
         {
             if (System.Windows.Application.Current.Windows.Count > 1)
             {
                 Window w = System.Windows.Application.Current.Windows[1];//the correct index of the window depn on your own application.   
                 RadDragAndDropManager.AddDragQueryHandler(w, OnDragQuery);
                 RadDragAndDropManager.AddDragInfoHandler(w, OnDragInfo);
                 RadDragAndDropManager.AddDropQueryHandler(w, OnDropQuery);
                 RadDragAndDropManager.AddDropInfoHandler(w, OnDropInfo);
             }   
         }

    Hope this helps.

    Regards,
    Rosi
    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
Back to Top