10 Answers, 1 is accepted
Thank you for writing.
Please refer to the following help article which demonstrates a sample approach how the replace the default EditAppointmentDialog with your custom one: http://docs.telerik.com/devtools/winforms/scheduler/appointments-and-dialogs/adding-a-custom-field-to-the-editappointment-dialog
I hope this information helps. Should you have further questions I would be glad to help.
Dess
Telerik
Thanks for your reply, i see your article and its very helpful for me, but i want edit this form with my requirement basically i have, Saturday , Sunday holiday , and my requirements is, i am not add any appointment these day, i have entered start date time, and end enter date time automatically assign appointment in working days Monday to Friday, not Saturday Sunday, can i change this , its possible to change this form with my requirements, then how to change this form with my requirements , i need help about this , your kind reply is needed .
Thanks
Addi Khan
Thank you for writing back.
I would recommend you to use the SchedulerWeekView and hide the weekend by setting the ShowWeekend property to false.
As to the EditAppointmentDialog, note that you can customize it in a way to accomplish your exact requirement and then replace the default dialog in the AppointmentEditDialogShowing event. It is possible to perform additional start/end date validation by overriding the EditAppointmentDialog.ValidateInput method.
Alternatively, you can disable the weekend dates in the RadDateTimePicker. Here is a sample code snippet demonstrating how to do it:
public
Form1()
{
InitializeComponent();
this
.radScheduler1.AppointmentEditDialogShowing += radScheduler1_AppointmentEditDialogShowing;
}
CustomEditAppointmentDialog appointmentDialog =
null
;
void
radScheduler1_AppointmentEditDialogShowing(
object
sender, AppointmentEditDialogShowingEventArgs e)
{
if
(
this
.appointmentDialog ==
null
)
{
this
.appointmentDialog =
new
CustomEditAppointmentDialog();
}
e.AppointmentEditDialog =
this
.appointmentDialog;
}
public
partial
class
CustomEditAppointmentDialog : EditAppointmentDialog
{
public
CustomEditAppointmentDialog()
{
InitializeComponent();
}
protected
override
void
LoadSettingsFromEvent(Telerik.WinControls.UI.IEvent sourceEvent)
{
base
.LoadSettingsFromEvent(sourceEvent);
RadDateTimePickerCalendar calendarBehavior =
this
.dateStart.DateTimePickerElement.GetCurrentBehavior()
as
RadDateTimePickerCalendar;
calendarBehavior.Calendar.ElementRender += Calendar_ElementRender;
}
private
void
Calendar_ElementRender(
object
sender, RenderElementEventArgs e)
{
if
(e.Day.Date.DayOfWeek == DayOfWeek.Saturday || e.Day.Date.DayOfWeek == DayOfWeek.Sunday)
{
e.Element.Enabled =
false
;
}
else
{
e.Element.Enabled =
true
;
}
}
}
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik
Hello Dess ,
Thanks for your Reply, This code very helpful for me, Thanks ,
i have one more question , please see attached image file , can i change radSchedulerNavigator1 start and end date i want show calendar with my requirements, and also i have appointments record in database , i want show these appointments in rad scheduler , with my custom color, how to show my database appointments in rad scheduler. Thanks
Thank you for writing back.
RadScheduler uses a data source provider model for data binding that targets highly customizable information storage and retrieval. Please refer to the following help article demonstrating how to bind RadScheduler: http://docs.telerik.com/devtools/winforms/scheduler/data-binding/data-binding-walkthrough
The SchedulerNavigatorElement.DateLabel displays the dates range that are displayed in the MonthView. You can control how many weeks will be displayed by setting SchedulerMonthView.WeekCount property.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik
Thanks for your reply Dess,
i have following code : i want to show appointment with my custom color , i saved in data base how to show color in appointment marker ...
if (fillcombo == true)
{
foreach (var item in General.GetQueryable<Gen_InsetDay>(c => c.ContractId != null && c.ContractId == ddlContractnumberwithschool.SelectedItem.Value.ToInt()))
{
ap = new LeadAppointment();
ap.Summary = item.Reason;
ap.Start = item.InsetDays.ToDate();
ap.End = item.InsetDays.ToDate();
IEvent ev = (IEvent)ap;
radScheduler1.Appointments.Add(ev);
}
}
}
Thank you for writing back.
In order to customize appointments' appearance, it is suitable to use the AppointmentFormatting event. Additional information is available at the following help article: http://docs.telerik.com/devtools/winforms/scheduler/appearance/formatting-appointments
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik
i want to delete selected appointment , that why i want to get ID, how to get id from appointment, please help
private void radScheduler1_AppointmentDeleted(object sender, SchedulerAppointmentEventArgs e)
{
InsetDaysBO objBO = new InsetDaysBO();
objBO.GetByPrimaryKey(id);
objBO.Delete(objBO.Current);
}
Thank you for writing back.
In order to customize the text, it is suitable to use a RadSchedulerLocalizationProvider and override the default string for the RadSchedulerStringId.PreviousAppointment. Additional information is available here: http://docs.telerik.com/devtools/winforms/scheduler/localization/translating-strings
You can use the Appointment.UniqueId property to distinguish which appointment has been deleted.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik