Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
440
multiple working time span in a single Day
posted

Hi,

when I set working hours in my UltraDayView i can modify only WorkDayStartTime and WorkDayEndTime properties.

For my application, I really need to manage a break  in the working day, so i have to set 2 different time span in the same day (for example from 8:00 to 12:00 and from 13:00 to 17:00) . Is there a way to do that?

Any suggestion really appreciated!!

Thanks!!

Stefano

Parents
  • 440
    Verified Answer
    posted

    Hi,
    I found the solution by myself, I set the dayView.ActiveOwner with default CalendarInfo owner and then I set my working hours in DayOfWeekSettings of the Actvie Owner.

    Here is a short example:

    //Set the ActiveOwner
    this.dayView.ActiveOwner = this.dayView.CalendarInfo.Owners[0];
    this.dayView.ActiveOwner.Name = "Onwer name";

    //set multiple working hours on Monday
    this.dayView.ActiveOwner.DayOfWeekSettings[DayOfWeekEnum.Monday].WorkingHours.Clear();
    this.dayView.ActiveOwner.DayOfWeekSettings[DayOfWeekEnum.Monday].WorkingHours.Add(new TimeSpan(8, 0, 0), new TimeSpan(12, 0, 0));
    this.dayView.ActiveOwner.DayOfWeekSettings[DayOfWeekEnum.Monday].WorkingHours.Add(new TimeSpan(14, 0, 0), new TimeSpan(18, 0, 0));

    //This row is very important to tell DayView to use ActiveOwner settings
    this.dayView.GroupingStyle = DayViewGroupingStyle.DateWithinOwner;

    Hope it helps!!

    Stefano

Reply Children