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

Selected Time on Scheduler SelectedDateCalendar

7 Answers 63 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
shahab
Top achievements
Rank 1
shahab asked on 26 Apr 2013, 05:40 AM
I have a problem with (RadCalendar)PatientScheduler.FindControl("SelectedDateCalendar"). everything is ok on popup calendar but seleteddate(systemselected.png) is different with user selecteddate(userselected.png)

7 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 30 Apr 2013, 01:22 PM
Hello shahab.
 
Would you please share what is the code you are using to transform the default PatientScheduler.FindControl("SelectedDateCalendar") to the one from the attached image so we could inspect the issue and think for a possible solution?


Kind regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
shahab
Top achievements
Rank 1
answered on 30 Apr 2013, 06:30 PM
I did not change seletedDate on runTime and I did not write code. when I want to change SelectedDate by using SelectedDateCalendar it selects different Time, showed Date in Pop SelectedDateCalendar is different with selected Date.
public partial class Patient_PatientScheduler : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
         if (!Page.IsPostBack)
        {
            //PatientScheduler.SelectedDate = DateTime.Now.AddDays(1);
            PatientScheduler.MinutesPerRow =Convert.ToInt32(ConfigurationManager.AppSettings["Interval"]);
        }
    }
    protected void PatientScheduler_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
    {       
        if (e.Appointment.Start < DateTime.Now)
        {
            e.Cancel = true;
            throw new Exception("time must be after today");
        }       
        if (e.Appointment.Start.TimeOfDay > e.Appointment.End.TimeOfDay)
        {
            e.Cancel = true;
            throw new Exception("start time must be before end time");
        }
 
        if(e.Appointment.End.TimeOfDay.Subtract(e.Appointment.Start.TimeOfDay) > new TimeSpan(0,15,0))
        {
            e.Cancel = true;
            throw new Exception("differece of start time and end time should be less than interval");
        }       
    }
    protected void PatientScheduler_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
    {
        TimeSpan endTime = e.ModifiedAppointment.End.TimeOfDay;
        e.ModifiedAppointment.End = e.Appointment.End;
        e.ModifiedAppointment.End = e.ModifiedAppointment.End.Add(endTime - e.ModifiedAppointment.End.TimeOfDay);
 
        TimeSpan startTime = e.ModifiedAppointment.Start.TimeOfDay;
        e.ModifiedAppointment.Start = e.Appointment.Start;
        e.ModifiedAppointment.Start = e.ModifiedAppointment.Start.Add(startTime - e.ModifiedAppointment.Start.TimeOfDay);
 
        if (e.ModifiedAppointment.Start.TimeOfDay > e.ModifiedAppointment.End.TimeOfDay)
        {
            e.Cancel = true;
            throw new Exception("start time must be before end time");
        }
    }
   
    protected void PatientScheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
        RadScheduler scheduler = (RadScheduler)sender;
        RadComboBox patientsComboBox = (RadComboBox)e.Container.FindControl("PatientsComboBox");
        if (patientsComboBox != null && Profile.PatientId != 0)
        {
            patientsComboBox.SelectedIndex = patientsComboBox.FindItemIndexByValue(Profile.PatientId.ToString());
            patientsComboBox.Enabled = false;
        }
        RadComboBox appointmentStatesComboBox = (RadComboBox)e.Container.FindControl("AppointmentStatesComboBox");
        if (appointmentStatesComboBox != null)
        {
            appointmentStatesComboBox.SelectedIndex = 0;
            appointmentStatesComboBox.Enabled = false;
        }
 
        RadComboBox doctorAppointmentComboBox = (RadComboBox)e.Container.FindControl("DoctorAppointmentComboBox");
        if (doctorAppointmentComboBox != null)
        {
            if (doctorAppointmentComboBox.Items.Count <= 0)
                throw new Exception("time must be exist");
        }
 
        RadTimePicker startTime = (RadTimePicker)e.Container.FindControl("StartTime");
        startTime.TimeView.StartTime = PatientScheduler.DayStartTime;
        startTime.TimeView.EndTime = PatientScheduler.DayEndTime;
        startTime.SelectedTime = e.Appointment.Start.TimeOfDay;
 
        RadTimePicker endTime = (RadTimePicker)e.Container.FindControl("EndTime");
        endTime.TimeView.StartTime = PatientScheduler.DayStartTime;
        endTime.TimeView.EndTime = PatientScheduler.DayEndTime;
        endTime.SelectedTime = e.Appointment.End.TimeOfDay;
        startTime.ClientEvents.OnDateSelected = "OnDateSelected";
        EndTimeHiddenField.Value = endTime.ClientID;
        DoctorsComboBox.Enabled = false;
    }   
    protected void DateCalendar_SelectionChanged(object sender, EventArgs e)
    {
        PatientScheduler.SelectedDate = DateCalendar.SelectedDate.Date;
        PatientScheduler.Rebind();
    }
    protected void PatientScheduler_PreRender(object sender, EventArgs e)
    {
        if (((RadCalendar)PatientScheduler.FindControl("SelectedDateCalendar")) != null)
            ((RadCalendar)PatientScheduler.FindControl("SelectedDateCalendar")).Visible = false;
    }
}
0
Plamen
Telerik team
answered on 03 May 2013, 01:22 PM
Hello shahab,

 
I have inspected the issue on my sample web page with Persian culture but could not observe the unusual issue. Here is a video of my test. Please review it and let me know what else should I do in order to observe the same behavior.

Regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
shahab
Top achievements
Rank 1
answered on 03 May 2013, 01:33 PM
Please select date from popup calendar, You just select from next and prev icon
0
Plamen
Telerik team
answered on 08 May 2013, 01:48 PM
Hello shahab,

 I have tested with clicking on the calendar but still could not observe the unusual behavior.Here is the new video. Would you please review it and let me know what else should I do in order to observe the same behavior.

Regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
shahab
Top achievements
Rank 1
answered on 08 May 2013, 03:46 PM
Dear Palman
Pleas notice in first selection you selected 20 of مرداد.
1.jpg
but in next image selected date is 31 of شهریور.
2.png
0
Plamen
Telerik team
answered on 09 May 2013, 06:51 AM
Hi shahab,

This transformation is caused by the fact that RadCalendar is not designed to display Persian calendar. Please excuse us for this limitation of our control.
 
All the best,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
shahab
Top achievements
Rank 1
Answers by
Plamen
Telerik team
shahab
Top achievements
Rank 1
Share this question
or