Load default status drop-down list

4 posts, 0 answers
  1. Emmanuel
    Emmanuel avatar
    7 posts
    Member since:
    Sep 2018

    Posted 13 Oct 2018 Link to this post


    Hello,

    As I can load the default drop-down list by default, I try it but it does not work in the load or the constructor event, but it works in the button that I put in test.


         It does not work
         public radFormAppointmentsEdit ()
             {
                 InitializeComponent ();
                 cmbShowTimeAs.SelectedValue = 3;
             }


        
         It does not work
         private void radFormAppointmentsEdit_Load (object sender, EventArgs e)
             {
                 cmbShowTimeAs.SelectedValue = 3;
             }


            It works
             private void radButtonTest_Click (object sender, EventArgs e)
             {
                 cmbShowTimeAs.SelectedValue = 3;
             }


    I just want it to work for me when I start the form, what can I do?
  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3324 posts

    Posted 15 Oct 2018 Link to this post

    Hello, Emmanuel, 

    The EditAppointmentDialog offers a specific LoadStatuses method which populates the drop down with data and selects the first item. This method can be overridden if you create a derivative of the EditAppointmentDialog. Then, after the basic logic of the method is performed you can execute your custom logic, e.g. set another item as selected. You can refer to the following help article demonstrating how to create a custom EditAppointmentDialog and replace the default one: https://docs.telerik.com/devtools/winforms/scheduler/appointments-and-dialogs/adding-a-custom-field-to-the-editappointment-dialog

    I hope this information helps. If you have any further questions, feel free to submit a support ticket from your account. Thus, our support staff will gladly assist you.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Emmanuel
    Emmanuel avatar
    7 posts
    Member since:
    Sep 2018

    Posted 15 Oct 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    As I can override the method and set by default, I had already created the EditAppointmentDialog derivative, from that same form of the custom EditAppointmentDialog

      public partial class radFormAppointmentsEdit: Telerik.WinControls.UI.Scheduler.Dialogs.EditAppointmentDialog
         {
             public radFormAppointmentsEdit ()
             {
                 InitializeComponent ();
             }

             protected override void LoadStatuses ()
             {
                 base.LoadStatuses ();

                
                 It does not work, I can not set it by default
                 this.cmbShowTimeAs.SelectedValue = 3;


                It works
                this.cmbShowTimeAs.Items.RemoveAt (0);
             }
    }


    I need your help, please how can I set another item as the first selected?
  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3324 posts

    Posted 16 Oct 2018 Link to this post

    Hello, Emmanuel, 

    In the LoadStatuses method the statuses are created and the first item is selected. You can adjust the selection by setting the SelectedValue property. However, the LoadSettingsFromEvent method is then executed and the status selection is synchronized with the appointment that is loaded/created for editing. 
     
    public partial class CustomEditAppointmentDialog : EditAppointmentDialog
    {
        public CustomEditAppointmentDialog()
        {
            InitializeComponent();
        }
     
        protected override void LoadSettingsFromEvent(Telerik.WinControls.UI.IEvent sourceEvent)
        {
            base.LoadSettingsFromEvent(sourceEvent);
            this.cmbShowTimeAs.SelectedValue = 3;
        }
    }

    I hope this information helps.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top