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

How to acces my controls in customized advanced template from AppointmentInsert/Update EventArgs

3 Answers 102 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Larevenge
Top achievements
Rank 1
Larevenge asked on 09 Dec 2010, 05:24 PM
At the moment i can access the controls already in my advanced customized template. I use the following code to do that:

protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
{
    Appointment appHuidig = e.Container.Appointment;
    RadScheduler scheduler = (RadScheduler)sender;
    RadDatePicker StartDate = (RadDatePicker)e.Container.Controls[1].FindControl("StartDate");
    RadTimePicker StartTime = (RadTimePicker)e.Container.Controls[1].FindControl("StartTime");
    RadDatePicker EndDate = (RadDatePicker)e.Container.Controls[1].FindControl("EndDate");
    RadTimePicker EndTime = (RadTimePicker)e.Container.Controls[1].FindControl("EndTime");
    RadComboBox rcb_AfspraakType = (RadComboBox)e.Container.Controls[1].FindControl("rcb_AfspraakType");
    RadTextBox SubjectText = (RadTextBox)e.Container.Controls[1].FindControl("SubjectText");
    RadTextBox DescriptionText = (RadTextBox)e.Container.Controls[1].FindControl("DescriptionText");
    RadComboBox rcb_Adviseurs = (RadComboBox)e.Container.Controls[1].FindControl("rcb_Adviseurs");
    int fiat = 1;
    RadComboBox rcb_Kamers = (RadComboBox)e.Container.Controls[1].FindControl("rcb_Kamers");
    CheckBox AllDayEvent = (CheckBox)e.Container.Controls[1].FindControl("AllDayEvent");
    RadTextBox rtb_ProspectID = (RadTextBox)e.Container.Controls[1].FindControl("rtb_ProspectID");

However, i also do have validation on the server side, but when i want to cancel the update and leave the advanced form template open I have a problem, since the AppointmentCommandEventArgs  doesnt have a cancel option. Besides this problem, I also want to implement drag and drop, however with drag and dropping i cannot access the Appointmentcommand as well.

So i want to move the update/insert from the appointmentcommand to the updatecommand/insertcommand:

protected void RadScheduler1_AppointmentInsert(object sender, Telerik.Web.UI.AppointmentInsertEventArgs e)
{
     
      
}
protected void RadScheduler1_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)
{
      
}

But from these e's i cannot access the cs_advancedform, how can i achieve this, so i can easely access my controls on my customized advanced form template?

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 15 Dec 2010, 12:40 PM
Hi Larevenge,

My suggestion would be to override the AdvancedForm.
Then the validation and update/create canceling will become pretty easy (you control what happens in this form). Also you don't need to start from scratch, since we have published the code of the AdvancedForm in this demo: http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx

"Besides this problem, I also want to implement drag and drop, however with drag and dropping i cannot access the Appointmentcommand as well."
 - I am having troubles understanding what exactly do you mean by the above-quoted, could you, please, clarify this a bit more?


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Larevenge
Top achievements
Rank 1
answered on 15 Dec 2010, 03:31 PM
This is an overridden advanced template and the problem is, that i can't cancel the update from the server side and i can't use drag and drop at the moment.

My question is, how i can access that advanced template in the update and insert command. Im doing everything from the server side, and it is really getting annoying, how poor the demo's are for doing everything server side. This means when developing i always have to wait 5 days or more when im getting stucked at something. This besides the fact that this scheduler is very laggy in Internet Explorer and my costumers are waiting till i finally get it fixed correctly.

So again, my question is, how can i access the overridden advanced form template from the AppointmentInsert and AppointmentUpdate?

"Besides this problem, I also want to implement drag and drop, however with drag and dropping i cannot access the Appointmentcommand as well."
 - I am having troubles understanding what exactly do you mean by the above-quoted, could you, please, clarify this a bit more?

What i mean is, i drag an appointment from 13.00 to 14.00, the problem is, that i only can update my appointements in appointmentcommand at the moment, because i cant access my overriden customized advanced form template from the appointmentinsert/update. But the dragging is only catched in the appointmentupdate and not in the appointmentcommand. So this means, drag and drop what you want but it wont save to the database at the moment.
0
Nikolay Tsenkov
Telerik team
answered on 20 Dec 2010, 02:48 PM
Hi Larevenge,

On drag&drop there isn't a form created. That is why you can not access it. The form is dynamically created for events on which this action is required. As you probably already know (but just in case there is some confusion), you can find the form only on AppointmentCommand.
If you need to be able to cancel the editing (the form's appearance) of a node you can use the FormCreating event for that purpose.

About "when developing i always have to wait 5 days or more when im getting stucked at something":
 - A post in the Support Forums doesn't guarantee you a response from the Telerik support team although 95% of all posts are eventually answered. Additionally, a post is not assigned a response time as with the support ticketing system. In case you need a faster and precise response, please start a new support ticket as it gets higher priority than Forum posts.


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Scheduler
Asked by
Larevenge
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Larevenge
Top achievements
Rank 1
Share this question
or