Override event and method Scheduler

11 posts, 0 answers
  1. Addi
    Addi avatar
    6 posts
    Member since:
    Feb 2016

    Posted 18 Feb Link to this post

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

  2. Dess
    Admin
    Dess avatar
    1605 posts

    Posted 19 Feb Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Addi
    Addi avatar
    6 posts
    Member since:
    Feb 2016

    Posted 19 Feb in reply to Dess Link to this post

    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

  5. Dess
    Admin
    Dess avatar
    1605 posts

    Posted 22 Feb Link to this post

    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
  6. Addi
    Addi avatar
    6 posts
    Member since:
    Feb 2016

    Posted 22 Feb Link to this post

    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

  7. Dess
    Admin
    Dess avatar
    1605 posts

    Posted 22 Feb Link to this post

    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
  8. Addi
    Addi avatar
    6 posts
    Member since:
    Feb 2016

    Posted 23 Feb Link to this post

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


                   

                    }
                }

            }

  9. Dess
    Admin
    Dess avatar
    1605 posts

    Posted 23 Feb Link to this post

    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
  10. Addi
    Addi avatar
    6 posts
    Member since:
    Feb 2016

    Posted 24 Feb Link to this post

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


            }

  11. Addi
    Addi avatar
    6 posts
    Member since:
    Feb 2016

    Posted 24 Feb Link to this post

    i want to change Previous Appointment name to Previous Inset Days , how to change this, please see attached image
  12. Dess
    Admin
    Dess avatar
    1605 posts

    Posted 26 Feb Link to this post

    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
Back to Top
UI for WinForms is Visual Studio 2017 Ready