Completed
Last Updated: 29 Jun 2016 06:36 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 11 Jun 2015 06:28
Category: Scheduler/Reminder
Type: Bug Report
0
FIX. RadScheduler - exception is thrown when you try to open the edit dialog and Arabic culture is set
To reproduce:
DateTime dtStart = DateTime.Today.AddDays(2).AddHours(10); 
DateTime dtEnd = DateTime.Today.AddDays(2).AddHours(12); 
Appointment appointment = new Appointment(dtStart, dtEnd, "TEST", "Description"); 
this.radScheduler1.Appointments.Add(appointment); 

System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ar-SA");

Try to open the edit dialog.


Workaround: create a custom dialog that inherits  RadSchedulerDialog and implements IEditAppointmentDialog. Thus, you will be able to handle the whole edit operation.

public class Scheduler : RadScheduler
{
    protected override IEditAppointmentDialog CreateAppointmentEditDialog()
    {
        return new MyDialog();
    }

    public override string ThemeClassName  
    { 
        get 
        { 
            return typeof(RadScheduler).FullName;  
        }
    }
}

public partial class MyDialog : RadSchedulerDialog, IEditAppointmentDialog
{
    public MyDialog()
    {
        InitializeComponent();
    }

    Appointment appointment;

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e); 

        //an example how specify the start date
        RadDateTimePicker dtStart = this.Controls[0] as RadDateTimePicker;
        dtStart.Value = this.appointment.Start;
    }
   
    public void ShowRecurrenceDialog()
    {
        //ToDo
    }

    public bool EditAppointment(Telerik.WinControls.UI.IEvent appointment, Telerik.WinControls.UI.ISchedulerData schedulerData)
    {
        this.appointment = appointment as Appointment;

        return true;
    }
}
0 comments