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

Load default status drop-down list

3 Answers 43 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Emmanuel
Top achievements
Rank 1
Emmanuel asked on 13 Oct 2018, 02:14 PM

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?

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Oct 2018, 07:38 AM
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.
0
Emmanuel
Top achievements
Rank 1
answered on 15 Oct 2018, 02:59 PM
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?
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Oct 2018, 08:49 AM
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.
Tags
Scheduler and Reminder
Asked by
Emmanuel
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Emmanuel
Top achievements
Rank 1
Share this question
or