Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drag and Drop from Calendar to other controls (Read 1803 times)
Simon_Verona
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Jun 28th, 2007
Drag and Drop from Calendar to other controls
Jun 28th, 2007 at 12:17pm
Print Post  
I'm trying to implement drag and drop functionality so that calendar items can be dragged into other (non mindfusion) control. I've got it so that it starts the drop operation, but can't work out the code to capture what has been dragged onto the new control.

I'm experimenting with code like : e.Data.GetData(System.Windows.Forms.DataFormats.StringFormat).ToString in the "dragenter" event for the control, but this doesn't get me anything.

As you may have guessed, I'm not very familiar with implementing drag and drop - can somebody point me in the right direction ?

Thanks in advance
Simon
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Drag and Drop from Calendar to other controls
Reply #1 - Jun 28th, 2007 at 12:40pm
Print Post  
Hi Simon,

Only thing is that we use the dragged calendar item itself as the data object and not a string. So the code in your case should be:

Code
Select All
...
if (e.Data.GetDataPresent(typeof(Appointment)))
{
    Appointment draggedItem = e.Data.GetData(typeof(Appointment)) as Appointment;
    string draggedItemHeader = draggedItem.HeaderText;
}
... 


Also ensure that the AllowDrop property of the target control is set to true. You might also have to handle the DragOver event of the target control and set the appropriate drag effect.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint