Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DragDrop in the same month, week or day (Read 4198 times)
elwin
Ex Member


DragDrop in the same month, week or day
Feb 18th, 2010 at 2:38pm
Print Post  
Hello,

I'm quite new with the calendar control. I'm trying some things in VB2008.
I'm showing a month, week or dayview with appointments. Now I want to drag and drop an appointment within the same view. This works automatically but I want to change an underlying proprty of the appointment.
I tried to put some code in the triggers DragDrop and DragEnter but without any result.
How can I change a property of the dragged appointment when dropping it?

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: DragDrop in the same month, week or day
Reply #1 - Feb 18th, 2010 at 2:55pm
Print Post  
You should handle the Calendar.ItemModified event and perform the necessary operations in the event handler. This event is raised when an item is moved or resized interactively by the user. Item interactions in the Calendar control are not realized as true drag-and-drop operations, therefore the Drag* events of the control are not raised for them.

Regards,
Meppy
  
Back to top
 
IP Logged
 
elwin
Ex Member


Re: DragDrop in the same month, week or day
Reply #2 - Feb 19th, 2010 at 7:58am
Print Post  
Thanks for the answer. I will try it today.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: DragDrop in the same month, week or day
Reply #3 - Feb 19th, 2010 at 2:32pm
Print Post  
On a side note, you can initiate true drag-and-drop operations on items by holding down the key specified by the Calendar.ItemDragKey property (CTRL by default) then clicking on an item and dragging. This is useful for special case scenarios, such as dragging an item from one instance of the Calendar control to another.

Regards,
Meppy
  
Back to top
 
IP Logged
 
DoctorsDad
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: May 19th, 2011
Re: DragDrop in the same month, week or day
Reply #4 - May 19th, 2011 at 4:33pm
Print Post  
Meppy wrote on Feb 18th, 2010 at 2:55pm:
You should handle the Calendar.ItemModified ........ the Drag* events of the control are not raised for them.
Meppy



Why then does the supplied sample use the normal DragDrop functions?

I'm currently struggling with my evaluation project because the DragOver is working but DragDrop refuses to fire and I can't see why. Reading this post has just confused me even more!

DoctorsDad ???
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DragDrop in the same month, week or day
Reply #5 - May 19th, 2011 at 5:13pm
Print Post  
What supplied sample are you alluding to? The DragOver and DragDrop events are raised for OLE drag and drop operations, which are used for transferring data between different controls or different applications. Moving an appointment within the same calendar does not start an OLE drag and drop operation, unless you press Ctrl at the same time. Are you dragging appointments between two calendar instances in this case, or do you need to detect when an appointment is being moved within its original calendar?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint