Postback firing form created event of Scheduler.

2 posts, 0 answers
  1. Lakpa
    Lakpa avatar
    13 posts
    Member since:
    Dec 2013

    Posted 28 Jan 2014 Link to this post

    Is there anyway I can block this event<FormCreated> from postback of User control elements.
    Currently I am having issue with it. Please check the image.

    1. In the FormCreated event I have
    if (e.Container.Mode == SchedulerFormMode.AdvancedInsert)
                    AgendaAppointment insertAppointment = (e.Container.FindControl("ucAppointmentInsert") as AgendaAppointment);
                    insertAppointment.CurrentUser = SessionManager.LoginUser;
                    insertAppointment.ActionDate = radSchAppTimeTodo.SelectedDate;

                    if (radSchAppTimeTodo.SelectedView == SchedulerViewType.DayView)
                        insertAppointment.TimeFrom = ((SchedulerAppointmentContainer)(e.Container)).Appointment.Start.TimeOfDay;
                        insertAppointment.TimeTo = ((SchedulerAppointmentContainer)(e.Container)).Appointment.End.TimeOfDay;
                        insertAppointment.TimeFrom = DateTime.Now.TimeOfDay;
                        insertAppointment.TimeTo = DateTime.Now.TimeOfDay;


    and its working fine for the first them.
    2. It sets the TIMEPICKER values of From and To and its difference are calculated and shown in Hours and Minue Integer text field which is correct.
    3. But when I increase or decrease the Integer field then postback occurs and those initial values are set again. So If I increase the hours or minute it gets rollback to old values.

    So is there anyway to block the form created event on postback.

  2. Boyan Dimitrov
    Boyan Dimitrov avatar
    2062 posts

    Posted 31 Jan 2014 Link to this post


    I would like to clarify that the OnFormCreated event is fired when the advanced form is opened. Please note that the logic is executed only when the form is opened and does not update the appointment object when you interact with the time pickers. By default when user tries to insert an appointment in the day view the date and time pickers are populated based on the clicked time slot start and end time. As far as I understand you want to repopulate the time pickers with the values that the user has set for the previous appointment. If this is the scenario you want to achieve you use two hidden fields on the page and store the time pickers new values in those fields. So you will be able to change the time pickers values in FormCreated event handler based on the values stored in those hidden fields. 

    Could you please confirm this and if not please explain the exact scenario. A sample scenario description and steps will be very helpful?

    Boyan Dimitrov
    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 UI for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top