This is a migrated thread and some comments may be shown as answers.

Override event and method Scheduler

10 Answers 146 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Addi
Top achievements
Rank 1
Addi asked on 18 Feb 2016, 10:39 PM

i want to override on radScheduler1_AppointmentEditDialogShowing how to override this method. because  its automatically opened own appointment editdialog ;(

10 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Feb 2016, 02:35 PM
Hello Addi,

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.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Addi
Top achievements
Rank 1
answered on 19 Feb 2016, 09:37 PM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Feb 2016, 11:37 AM
Hello Addi,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Addi
Top achievements
Rank 1
answered on 22 Feb 2016, 12:29 PM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Feb 2016, 03:59 PM
Hello Addi,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Addi
Top achievements
Rank 1
answered on 23 Feb 2016, 01:38 PM

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);
                    


               

                }
            }

        }

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Feb 2016, 02:16 PM
Hello Addi,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Addi
Top achievements
Rank 1
answered on 24 Feb 2016, 08:20 AM

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);


        }

0
Addi
Top achievements
Rank 1
answered on 24 Feb 2016, 11:32 AM
i want to change Previous Appointment name to Previous Inset Days , how to change this, please see attached image
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Feb 2016, 02:16 PM
Hello Addi,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Addi
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Addi
Top achievements
Rank 1
Share this question
or