Selected Time on Scheduler SelectedDateCalendar

8 posts, 0 answers
  1. shahab
    shahab avatar
    58 posts
    Member since:
    Mar 2009

    Posted 26 Apr 2013 Link to this post

    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)
  2. Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 30 Apr 2013 Link to this post

    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.
  3. shahab
    shahab avatar
    58 posts
    Member since:
    Mar 2009

    Posted 30 Apr 2013 Link to this post

    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;
        }
    }
  4. Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 03 May 2013 Link to this post

    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.
  5. shahab
    shahab avatar
    58 posts
    Member since:
    Mar 2009

    Posted 03 May 2013 Link to this post

    Please select date from popup calendar, You just select from next and prev icon
  6. Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 08 May 2013 Link to this post

    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.
  7. shahab
    shahab avatar
    58 posts
    Member since:
    Mar 2009

    Posted 08 May 2013 Link to this post

    Dear Palman
    Pleas notice in first selection you selected 20 of مرداد.
    1.jpg
    but in next image selected date is 31 of شهریور.
    2.png
  8. Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 09 May 2013 Link to this post

    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.
Back to Top