Drag and Drop TreeView to Scheduler

4 posts, 0 answers
  1. Carlos Rodriguez
    Carlos Rodriguez avatar
    72 posts
    Member since:
    Aug 2009

    Posted 04 Sep 2009 Link to this post

    Hello!
    I hope to help me, I try to drag and drop of a Treeview to a Scheduler.

    I have dealt with the existing code but does not work.

    tnks!!
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 07 Sep 2009 Link to this post

    Hello Carlos Rodriguez,

    There isn't anything special when drag/drop from treeview to scheduler. What is your scenario and what problems you are facing?

    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.
  3. DevCraft banner
  4. Carlos Rodriguez
    Carlos Rodriguez avatar
    72 posts
    Member since:
    Aug 2009

    Posted 07 Sep 2009 Link to this post

    I tried a code already exists, I placed a TreeView and a scheduler and when I take the information of where to loosen it gives me null value, this is the code:

    private

     

    void OnDropInfo(object sender, DragDropEventArgs e)

     

    {

     

        try

     

        {

     

            var sourceTreView = e.Options.Source as Telerik.Windows.Controls.TreeView.TreeViewDragCue;

     

     

            var item = e.Options.Destination as TimeSlotItem;

     

     

            if (e.Options.Status == DragStatus.DragComplete && item != null)

     

            {

     

                Appointment punto = new Appointment();

     

                punto.Start = item.TimeSlot.Start;

                punto.End = item.TimeSlot.End;

                punto.Subject = e.Options.Source.Name;

                CalendarioPrincipal.Appointments.Add(punto);

            }

        }

     

        catch (Exception parException)

     

        {

     

            throw new Exception(parException.Message);

     

        }

    }

  5. Carlos Rodriguez
    Carlos Rodriguez avatar
    72 posts
    Member since:
    Aug 2009

    Posted 07 Sep 2009 Link to this post

    already solved the problem, was no data of the destination. is very easy, thank you very much. if you want the code is the same as they have here in the forum, but I use it for a treeview and a scheduler.
Back to Top