The MindFusion Forums
Scheduling and Gantt Components >> WPF >> Timetable Expanding Appointments
https://mindfusion.eu/Forum/YaBB.pl?num=1545315279

Message started by Nika on Dec 20th, 2018 at 2:14pm

Title: Timetable Expanding Appointments
Post by Nika on Dec 20th, 2018 at 2:14pm
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):
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):
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!

Title: Re: Timetable Expanding Appointments
Post by Slavcho on Dec 21st, 2018 at 9:00am
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

Title: Re: Timetable Expanding Appointments
Post by Nika on Dec 21st, 2018 at 9:24am
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!  :)

Title: Re: Timetable Expanding Appointments
Post by Slavcho on Dec 21st, 2018 at 9:56am
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

The MindFusion Forums » Powered by YaBB 2.6.11!
YaBB Forum Software © 2000-2024. All Rights Reserved.