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

Drag and Drop TreeView to Scheduler

3 Answers 90 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Carlos Rodriguez
Top achievements
Rank 1
Carlos Rodriguez asked on 04 Sep 2009, 04:51 PM
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!!

3 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 07 Sep 2009, 08:02 AM
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.
0
Carlos Rodriguez
Top achievements
Rank 1
answered on 07 Sep 2009, 03:18 PM
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);

 

    }

}

0
Carlos Rodriguez
Top achievements
Rank 1
answered on 07 Sep 2009, 04:35 PM
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.
Tags
DragAndDrop
Asked by
Carlos Rodriguez
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Carlos Rodriguez
Top achievements
Rank 1
Share this question
or