Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Moving and resizing appointments in TimeTable view (Read 4230 times)
Aleksandar
YaBB Newbies
*
Offline


I Love MindFusion! I really
do! :)

Posts: 11
Location: Serbia
Joined: May 28th, 2017
Moving and resizing appointments in TimeTable view
May 28th, 2017 at 10:40pm
Print Post  
Hi there.
First of all, thank You (the MindFusion team) for this wonderful package of controls!
Scheduling is just awesome! Cool

Please answer as soon as You can, since I am working on a project that should be done by Thursday (June the 1st). Cry

Here is why I am here: I want to create appointments only by drag-dropping them from a list. I disabled the creation of items by text typing but other issues remain.

My questions:
  1. How to disable (or stop from) moving an appointment outside the defined range (as shown on attached images below). I know it is moved below the time limit, since i output the StartTime and EndTime, on click, into the console window. The output is:
    Code
    Select All
    7:05 AM - 7:50 AM
    7:00 AM - 7:45 AM
    6:55 AM - 7:40 AM 
    
    
  2. How to disable resizing of my appointments?
  

case_1.PNG ( 3 KB | 241 Downloads )
case_1.PNG
case_2.PNG ( 3 KB | 229 Downloads )
case_2.PNG
case_3.PNG ( 3 KB | 212 Downloads )
case_3.PNG
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Moving and resizing appointments in TimeTable view
Reply #1 - May 29th, 2017 at 8:12am
Print Post  
Hi,

1. You can control user interactions with the items through the Calendar.ItemModifying event. For example, to prevent the user from dragging items before 7:00 AM, you can use the following code:

Code
Select All
calendar.ItemModifying += (s, e) =>
	{
		if (e.Item.StartTime.TimeOfDay < TimeSpan.FromHours(7))
			e.Confirm = false;
	}; 


2. To disable resizing an item, set its AllowChangeStart and AllowChangeEnd properties to false.

Let me know if this helps.

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


I Love MindFusion! I really
do! :)

Posts: 11
Location: Serbia
Joined: May 28th, 2017
Re: Moving and resizing appointments in TimeTable view
Reply #2 - May 29th, 2017 at 9:35am
Print Post  
Wow! Works like a charm! Thank You, sir!
  1. Any idea on how to remove/hide the resize cursor, since I don't need it now?
  2. How to disable overlaping of items? Can it be done through XAML/properties? I

Many thanks!


Kind regards,
Aleksandar
  

view_1.PNG ( 3 KB | 219 Downloads )
view_1.PNG
view_2.PNG ( 3 KB | 220 Downloads )
view_2.PNG
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Moving and resizing appointments in TimeTable view
Reply #3 - May 29th, 2017 at 11:05am
Print Post  
Hi,

1. It is currently not possible to disable the resize cursors.
2. To visually disable collisions, set Calendar.TimetableSettings.EnableCollisions to false. To prevent collisions from happening, you must again use the Calendar.ItemModifying event and check if an item will collide with another item:

Code
Select All
calendar.ItemModifying += (s, e) =>
	{
		if (e.Item.StartTime.TimeOfDay < TimeSpan.FromHours(7))
			e.Confirm = false;

		if (calendar.Schedule.GetAllItems(e.Item.StartTime, e.Item.EndTime).Count > 1)
			e.Confirm = false;
	}; 


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


I Love MindFusion! I really
do! :)

Posts: 11
Location: Serbia
Joined: May 28th, 2017
Re: Moving and resizing appointments in TimeTable view
Reply #4 - May 29th, 2017 at 9:55pm
Print Post  
Meppy wrote on May 29th, 2017 at 11:05am:
1. It is currently not possible to disable the resize cursors.
2. To visually disable collisions, set Calendar.TimetableSettings.EnableCollisions to false. To prevent collisions from happening, you must again use the Calendar.ItemModifying event and check if an item will collide with another item:

About the #1 - I changed the theme from "Light" to "Silver" and the resize cursor isn't present at all, so, I think that solved my problem.
About the #2 - I did as You suggested, and it works great! Since I need the events not to overlap, I added some extra checks, but I will write more about my solutions tomorrow.

Thank You once again!  Cheesy

Kind regards,
Aleksandar
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint