BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Pavel
Thanks for using Syncfusion product.
As of now we don't have any direct support to set different
NonWorkingHours at every day in week view but your requirement can be achieved
in sample level by creating custom Appointment with additional fields and
AppointmentTemplate. We have prepared sample based on your requirement and
please find the sample in the below link.
Sample link:
In the above sample we have added the additional fields to
the ScheduleAppointment to create blocking hours by using appointment. Please
find the below KB article for more details about creating appointment with
additional fields.
KB link: https://www.syncfusion.com/kb/5833/how-to-add-additional-entities-to-the-sheduleappointment-class
In the above sample we have created IsBlockHours propery in
the ScheduleAppointment class to create blocking hours using appointment. We
have used below code snippet for creating custom appointment in schedule
control.
C#:
Source = new ScheduleAppointmentCollection { new
CustomAppointment{IsBlockHours=true,Subject="BlockedHours",StartTime=DateTime.Now.Date.AddHours(1),EndTime=DateTime.Now.Date.AddHours(2)}, new
CustomAppointment{IsBlockHours=false,Subject="CheckUp",StartTime=DateTime.Now.Date.AddDays(1).AddHours(1),EndTime=DateTime.Now.Date.AddDays(1).AddHours(8)}, }; this.DataContext = this;
|
We have used below convertors to decrease the opacity of
appointment for creating blocked hours and HitTestVisible set to false to stop
the user interaction. Please fin the below code snippet for the same.
C#:
public class OpacityConvertor :
IValueConverter { public object Convert(object value, Type
targetType, object parameter, string language) { var app = value as CustomAppointment; if (app.IsBlockHours == true) return 0.2; else return 1; } public object ConvertBack(object value, Type
targetType, object parameter, string language) { throw new NotImplementedException(); } } public class HitTestVisibleConvertor
: IValueConverter { public object Convert(object value, Type
targetType, object parameter, string language) { var app = value as CustomAppointment; if (app.IsBlockHours == true) return false; else return true; } public object ConvertBack(object value, Type
targetType, object parameter, string language) { throw new NotImplementedException(); } }
|
We have also disabled context menu and appointment editor by
using ContextMenuOpening and AppointmentEditorOpening event when interacting
with the blocked area.
Please let us know if you have any concern.
Regards
Vigneshkumar R
Hi Pavel,
Thanks for your update. Please let us know if you need further assistance on this.
Regards
Vigneshkumar R