Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Getting information about an Item being moved with drag & drop (Read 2558 times)
Achim
Junior Member
**
Offline


MindFusion rocks!

Posts: 70
Location: Bayreuth, Germany
Joined: Jun 28th, 2012
Getting information about an Item being moved with drag & drop
Jul 3rd, 2012 at 11:30am
Print Post  
Hi there,

I was wondering if there is a possibility to influence the drag & drop behaviour of existing items.

When I drag & drop an Item from one resource to another, none of the Drag-events gets fired. So I  have no information about an Item being dragged with the mouse.

My intention is to restrict the user to move the items between different resources. So vertical movement is allowed, horizontal movement is forbidden.

Can anyone help me?

Best regards
Achim
  
Back to top
WWW  
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Getting information about an Item being moved with drag & drop
Reply #1 - Jul 3rd, 2012 at 12:21pm
Print Post  
You can handle the Calendar.ItemModifying event in order to control item interactions (the Drag* events are used only for OLE drag&drop operations). The following code illustrates how to allow items to change resource association but to prohibit them from changing start and end time:

Code
Select All
void calendar1_ItemModifying(object sender, ItemModifyConfirmEventArgs e)
{
	if (e.NewStartTime != e.Item.StartTime || e.NewEndTime != e.Item.EndTime)
 		e.Confirm = false;
} 


I hope this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Achim
Junior Member
**
Offline


MindFusion rocks!

Posts: 70
Location: Bayreuth, Germany
Joined: Jun 28th, 2012
Re: Getting information about an Item being moved with drag & drop
Reply #2 - Jul 3rd, 2012 at 1:23pm
Print Post  
Hi Meppy,

thanks for the hint. Here's a more user friendly way:

Code (C++)
Select All
        private void scheduleView_ItemModifying(object sender, ItemModifyConfirmEventArgs e)
        {
            if (e.NewStartTime != e.Item.StartTime) e.NewStartTime = e.Item.StartTime;
            if (e.NewEndTime != e.Item.EndTime) e.NewEndTime = e.Item.EndTime;
            e.Confirm = true;
        }
 



I tested it and it works interactively, so the user sees the Items moving only vertically when he moves it accross the resources.

Perfect!

Achim
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint