A requirement in my project is to dynamically create schedulers. I'm already able to achieve that, but I also want to customize the AdvancedInsertTemplate/AdvancedEditTemplate. How do I do this from code-behind, since I'm creating a scheduler from code-behind too?
Thank you very much.
11 Answers, 1 is accepted
Similarly to this kb article, you can add AdvancedInsert or AdvancedEdit template dynamically like this:
public
partial
class
Default13 : System.Web.UI.Page
{
protected
void
Page_Init(
object
sender, EventArgs e)
{
RadScheduler1.AdvancedInsertTemplate =
new
AppInsertTemplate ();
}
}
public
class
AppInsertTemplate : IBindableTemplate
{
#region IBindableTemplate Members
public
System.Collections.Specialized.IOrderedDictionary ExtractValues(Control container)
{
throw
new
NotImplementedException();
}
#endregion
#region ITemplate Members
public
void
InstantiateIn(Control container)
{
RadTextBox subject =
new
RadTextBox();
subject.Text =
"test"
;
container.Controls.Add(subject);
}
#endregion
}
The above code is just a simple example which shows how to add RadTextBox to the advanced form. For adding more functionality, I suggest you refer to the source code of the AdvancedTemplate, AdvancedInsertTemplate and AdvancedEditTemplate classes which I have attached for reference.
Greetings,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
You need to double click on a time slot or an appointment. With default settings, this will cause the inline insert or edit form to show up. Then you need to click on the "options" link to open the advanced insert or edit form. If you want to open the advanced form directly, you need to the following RadScheduler's properties:
StartInsertingInAdvancedForm="true"
StartEditingInAdvancedForm="true"
Greetings,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Yes, I have set StartInsertingInAdvancedForm="true" and StartEditingInAdvancedForm="true", and also double-clicking, but nothing appears. Without setting a custom form/template, the default form/template shows.
Thanks.
Probably, you are using the modal popup form (<AdvancedForm Modal="true" />). If that's the case, please see this help topic:
http://www.telerik.com/help/aspnet-ajax/scheduler-custom-modal-advanced-template.html
You need to implement the html provided in the above article in your dynamic template. I suggest you first experiment with the code declaratively to just to check what result it will yield.
Greetings,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
But from the IBindableTemplate, how would I be able to know if the mode is Insert or Edit?
You can use the following server-side methods:
RadScheduler1.ShowAdvancedEditForm()
RadScheduler1.ShowAdvancedInsertForm()
Greetings,
Peter
the Telerik team
I am facing a problem while using advance insert template. I need to change the back color of appointments. That will be done using a status field which is in database. There are three status flags.
- Approve
- Pending
- Reject
For each status I need to show the back-ground color of appointments.
Initailly the color will be orange that indicates 'Pending' Status.
After approval, that will affect in databse & the appointment back color will be changed from Orange to Green, that indicates 'Approved' Status.
And after rejection, the appointments back color will be shown in Red Color which will also reflect into the databse (i.e. 'Rejected' Status).
So is it possible in case of using AdvanceInsert Template.?
As i have referred many examples & it is shown using appointment_databound().
But as I am using advance isnert template, I need to use the property which are form_creating, form_created & radscheduler_command property. So where should i write the code for diffrent appointment according to their status.
please revert as soon as possible.
Thanks & Regards
Amit Thakkar
You can use custom attributes to store the color of the appointment. Such an approach is used in the Advanced Templates demo which you can use for reference.
Kind regards,
Peter
the Telerik team