Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Timetable Expanding Appointments (Read 2706 times)
Nika
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Oct 11th, 2018
Timetable Expanding Appointments
Dec 20th, 2018 at 2:14pm
Print Post  
Hello!

I would like to expand an appointment by clicking on it or by hovering over it. I couldn't find any useful function to do so, so i tried to set the EndTime of the appointment to a time, where the appointment is fully seen. This works so far. But when I try to set it to the old EndTime, the ItemModifying event isn't called and I don't know how to call it manually.

Is there any better solution to this? And if not, how can I call this event?

This is what I have so far:

Code (CSS)
Select All
private void calendar_ItemClick(object sender, MindFusion.Scheduling.Wpf.ItemMouseEventArgs e)
        {
                MyAppointment app = (MyAppointment)calendar.ItemSelection.Items[0];
                actualEndTime = app.EndTime;
                app.EndTime = app.StartTime + new TimeSpan(2, 30, 0);
        }
 



(this method works)

Code (CSS)
Select All
private void calendar_ItemDeselecting(object sender, MindFusion.Scheduling.Wpf.ItemConfirmEventArgs e)
        {
            MyAppointment app = (MyAppointment)e.Item;
            app.EndTime = actualEndTime;
        }
 


(this doesn't)

Thanks for your answer in advance!
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 2157
Joined: Oct 19th, 2005
Re: Timetable Expanding Appointments
Reply #1 - Dec 21st, 2018 at 9:00am
Print Post  
Hi,

If only problems is running some code from ItemModifying event handler, you could refactor it extracting to a separate function and then calling the function from both ItemModifying and ItemDeselecting handlers. You might also consider displaying some separate dialog / window on top of the item to implement expand instead of changing its end time.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Nika
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Oct 11th, 2018
Re: Timetable Expanding Appointments
Reply #2 - Dec 21st, 2018 at 9:24am
Print Post  
The code in the ItemModifying handler isn't important at all. What I mean is that the appointment doesn't get smaller when I set the EndTime to earlier.

I already had a window like that, but my boss clarified that he wanted to see the Item expanded and not in another dialogue, so I tried it with setting the EndTime. But I guess I'll have to go back to the roots.

Thanks for your fast answer!  Smiley
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 2157
Joined: Oct 19th, 2005
Re: Timetable Expanding Appointments
Reply #3 - Dec 21st, 2018 at 9:56am
Print Post  
There's no reason for app.EndTime assignment to fail. Have you verified the actualEndTime variable value hasn't changed meanwhile, e.g. from a second click while item is expanded?

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