Hi All,
I am using ig:XamDayView to display configured working hours.
There are three Shifts for each 'working day':
- Shift 1: from 7:00 to 15:00
- Shift 2: from 15:00 to 23:00
- Shift 3: from 23:00 to 7:00 (next day).
It is ok to display working hours for Shift 1 and Shift 2 but I got issue with Shift 3 since it spread over two days.
For Shift 3, I want the XamDayView displays 8 hours as 23:00, 00:00, 1:00, 2:00,.....7:00
But it currently display as : 7:00, 8:00,9:00,....23:00
I tried to break the shift to two TimeRange as (23:00, 00:00) and (00:00, 07:00) but it does not work as expected.
Please help to resolve.
Thanks,
Chu - VNETSOFTWARE
Hi Chu,
You can try the following code to achieve your goal:
<ig:XamScheduleDataManager.Settings>
<ig:ScheduleSettings>
<ig:ScheduleSettings.WorkingHours>
<ig:WorkingHoursCollection>
<ig:TimeRange Start="23:0:0" End="23:59:59"></ig:TimeRange>
<ig:TimeRange Start="0:0:0" End="7:0:0"></ig:TimeRange>
</ig:WorkingHoursCollection>
</ig:ScheduleSettings.WorkingHours>
Please let me know if this is not working for you!
Diyan Dimitrov
Hi Diyan Dimitrov,
I have to dynamic set the Working Hours at run-time. Here is my code:
----------------
if (dataManager.Settings == null) { dataManager.Settings = new Infragistics.Controls.Schedules.ScheduleSettings(); } dataManager.Settings.WorkingHours = new Infragistics.Controls.Schedules.WorkingHoursCollection();
TimeSpan midNight = new TimeSpan(23,59,59); TimeSpan newDay = new TimeSpan(0,0,0);
TimeSpan st = (TimeSpan)dataItem.Row["StartTime"];TimeSpan et = (TimeSpan)dataItem.Row["EndTime"];
dataManager.Settings.WorkingHours.Add(st,midNight);dataManager.Settings.WorkingHours.Add(newDay, et);
//where st and et is the real Start and End Time.
// st is between 23:00:00 and 23>59:59 and et is between 0:0:0 and 7:0:0
----------------------------
But the control display the working hours as 0:00, 1:00, 2:00, 3:00, 4:00, 5:00, 6:00, 23:00 (from Top to bottom)
I want the control display as 23:00, 0:00, 0:00, 1:00, 2:00, 3:00, 4:00, 5:00, 6:00 from top to bottom
Is there any other settings for this?
Regards,
Chu