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

Postback firing form created event of Scheduler.

1 Answer 38 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Lakpa
Top achievements
Rank 1
Lakpa asked on 29 Jan 2014, 12:55 AM
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;
                }
                else
                {
                    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.




 

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 31 Jan 2014, 12:08 PM
Hello,

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?

Regards,
Boyan Dimitrov
Telerik
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.
Tags
Scheduler
Asked by
Lakpa
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or