I am wanting to create custom Display, Insert, and Edit templates. I need to do all this through code behind, I have no access to the aspx page.
I found a few posts getting me part of the way there:
I am having trouble figuring out how to add the HTML elements below to the scheduler, through code-behind.
<AppointmentTemplate> |
(<asp:Literal ID="AppointmentStartTime" runat="server" Text='<%# Eval("Start", "{0:t}") %>'></asp:Literal> |
- |
<asp:Literal ID="AppoitmentEndTime" runat="server" Text='<%# Eval("End", "{0:t}") %>'></asp:Literal>) |
<asp:Literal ID="AppointmentSubject" runat="server" Text='<%# Eval("Subject") %>'></asp:Literal> |
</AppointmentTemplate> |
Any help is appreciated. Thanks!
8 Answers, 1 is accepted
0
Hello Joe,
Let us know if you need further assistance with this task.
Kind regards,
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 can implement that specific appointment template dynamically with the following code:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
Telerik.Web.UI;
using
System.Text;
public
partial
class
Default5 : System.Web.UI.Page
{
protected
void
Page_Init(
object
sender, EventArgs e)
{
RadScheduler1.AppointmentTemplate =
new
AppTemplate();
}
}
public
class
AppTemplate : ITemplate
{
public
void
InstantiateIn(Control container)
{
Literal subject =
new
Literal();
subject.DataBinding += subject_DataBinding;
container.Controls.Add(subject);
}
private
void
subject_DataBinding(
object
sender, EventArgs e)
{
Literal subject = (Literal)sender;
//Access the appointment object
SchedulerAppointmentContainer aptCont = (SchedulerAppointmentContainer)subject.Parent;
Appointment app = aptCont.Appointment;
StringBuilder sb =
new
StringBuilder();
sb.Append(app.Subject);
sb.Append(
"</br>"
);
sb.Append(
"("
);
sb.Append(String.Format(
"{0:t}"
, app.Start));
sb.Append(
"-"
);
sb.Append(String.Format(
"{0:t}"
, app.End));
sb.Append(
")"
);
subject.Text = sb.ToString();
}
}
Let us know if you need further assistance with this task.
Kind regards,
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.
0
Joe
Top achievements
Rank 1
answered on 14 Dec 2009, 03:58 PM
Thanks Peter for the info.
I am having problems implementing the AdvancedEditForm, I have the following code:
On_Init
I was trying to just create something quick and simple to see if it worked. So I just added a bunch of controls to the collection. I am getting an error when I double click an appointment to edit.
Unable to cast object of type 'WIT.Scheduler.AdvancedEditFormTemplate' to type 'System.Web.UI.IBindableTemplate.'
That error doesn't make any sense. As you see above, I am implementing ITemplate not IBindableTemplate, so I am really not sure how I'm even getting that specific error.
Any ideas? Thanks!
I am having problems implementing the AdvancedEditForm, I have the following code:
On_Init
conScheduler.AdvancedEditTemplate =
new AdvancedEditFormTemplate();
public class AdvancedEditFormTemplate : ITemplate |
{ |
public void InstantiateIn(Control container) |
{ |
RadTextBox txtDescription = new RadTextBox(); |
txtDescription.ID = "txtDescription"; |
container.Controls.Add(txtDescription); |
RadDatePicker dpStartDate = new RadDatePicker(); |
dpStartDate.ID = "dpStartDate"; |
container.Controls.Add(dpStartDate); |
RadTimePicker tpStartTime = new RadTimePicker(); |
tpStartTime.ID = "tpStartTime"; |
container.Controls.Add(tpStartTime); |
RadDatePicker dpEndDate = new RadDatePicker(); |
dpEndDate.ID = "dpEndDate"; |
container.Controls.Add(dpEndDate); |
RadTimePicker tpEndTime = new RadTimePicker(); |
tpEndTime.ID = "tpEndTime"; |
container.Controls.Add(tpEndTime); |
CheckBox cbxAllDay = new CheckBox(); |
cbxAllDay.ID = "cbxAllDay"; |
container.Controls.Add(cbxAllDay); |
} |
} |
I was trying to just create something quick and simple to see if it worked. So I just added a bunch of controls to the collection. I am getting an error when I double click an appointment to edit.
Unable to cast object of type 'WIT.Scheduler.AdvancedEditFormTemplate' to type 'System.Web.UI.IBindableTemplate.'
That error doesn't make any sense. As you see above, I am implementing ITemplate not IBindableTemplate, so I am really not sure how I'm even getting that specific error.
Any ideas? Thanks!
0
Hi Joe,
Kind regards,
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 inhderit IBindableTemplate for the advanced form. Please, see this forum thread for mored details and a demo project:
http://www.telerik.com/community/forums/aspnet-ajax/scheduler/set-custom-advanced-form-from-code-behind.aspx#1011427
Kind regards,
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.
0
Joe
Top achievements
Rank 1
answered on 17 Dec 2009, 06:30 PM
Thanks Peter. Got that part all working.
Quick follow up question. I am wanting to just add some custom controls to the standard control set with standard styling. But what I am finding is that I have to build all controls inside my custom template, which is fine. But, I want my edit and insert forms to be styled just like the originals, keeping the ability to change based on a selected skin. I haven't found anywhere that details the HTML/CSS elements needed to build the forms in this manner. Is that information available?
Thanks again for your help.
0
Hi Joe,
AdvancedForm.ascx.cs
Kind regards,
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.
The way we achieve skin consistency for controls in the Advanced Templates demo (a working sample of which you can dowload from here) is by exposing the RadScheduler object (Owner) and setting the Skin property of the control like this:
AdvancedForm.ascx
<
telerik:RadTimePicker
runat
=
"server"
ID
=
"EndTime"
CssClass
=
"rsAdvTimePicker"
Width
=
"65px"
Skin='<%# Owner.Skin %>' Culture='<%# Owner.Culture %>'>
AdvancedForm.ascx.cs
protected
RadScheduler Owner
{
get
{
return
Appointment.Owner;
}
}
Kind regards,
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.
0
Joe
Top achievements
Rank 1
answered on 21 Dec 2009, 06:12 PM
Peter,
Thanks for the info, but I think you missed what I am asking for here. I am building the Advanced Templates completely through code behind - so I am not using the user controls. (Also, I am using version Q3 2008)
I am able to skin the controls inside the templates just fine. The part that I don't have is the CSS definitions for the div wrappers around the controls. I want to keep the look and feel of the form styles (background colors, padding, borders, etc) and allow those items to be changed when the skin of the scheduler is changed. I assume this is done in the default skins through specific CSS classes. (See link below to the Templates on your site, also my code example below, i.e. - qsfexAdvEditWrapper)
I built my templates using this example: http://www.telerik.com/help/aspnet-ajax/schedule_appearancetemplates.html
So I implemented the classes specified here, but without any results. So I am assuming these were customized classes that aren't part of the skins. I need the correct definitions that will work with the default skins included in the control.
Here is my template code for reference. Thanks.
Form Created event where I am successfully setting the skin of the controls inside the form
Thanks for the info, but I think you missed what I am asking for here. I am building the Advanced Templates completely through code behind - so I am not using the user controls. (Also, I am using version Q3 2008)
I am able to skin the controls inside the templates just fine. The part that I don't have is the CSS definitions for the div wrappers around the controls. I want to keep the look and feel of the form styles (background colors, padding, borders, etc) and allow those items to be changed when the skin of the scheduler is changed. I assume this is done in the default skins through specific CSS classes. (See link below to the Templates on your site, also my code example below, i.e. - qsfexAdvEditWrapper)
I built my templates using this example: http://www.telerik.com/help/aspnet-ajax/schedule_appearancetemplates.html
So I implemented the classes specified here, but without any results. So I am assuming these were customized classes that aren't part of the skins. I need the correct definitions that will work with the default skins included in the control.
Here is my template code for reference. Thanks.
public void InstantiateIn(Control container) |
{ |
//Declare Controls |
//Description |
Label lblDescription = new Label(); |
lblDescription.ID = "SubjectTextBox"; |
lblDescription.CssClass = "inline-label"; |
lblDescription.AssociatedControlID = "TitleTextBox"; |
lblDescription.Text = "Description:"; |
RadTextBox txtDescription = new RadTextBox(); |
txtDescription.ID = "TitleTextBox"; |
txtDescription.Rows = 5; |
txtDescription.Columns = 20; |
txtDescription.Width = Unit.Percentage(95); |
txtDescription.TextMode = InputMode.MultiLine; |
//Start Date |
Label lblStartDate = new Label(); |
lblStartDate.ID = "lblStartDate"; |
lblStartDate.AssociatedControlID = "StartInput"; |
lblStartDate.CssClass = "inline-label"; |
lblStartDate.Text = "Start Time:"; |
RadDateInput dpStartDate = new RadDateInput(); |
dpStartDate.ID = "StartInput"; |
//End Date |
Label lblEndDate = new Label(); |
lblEndDate.ID = "lblEndDate"; |
lblEndDate.AssociatedControlID = "EndInput"; |
lblEndDate.CssClass = "inline-label"; |
lblEndDate.Text = "End Time:"; |
RadDateInput dpEndDate = new RadDateInput(); |
dpEndDate.ID = "EndInput"; |
//Resource |
Label lblResource = new Label(); |
lblResource.ID = "lblResource"; |
lblResource.AssociatedControlID = "ResourceInput"; |
lblResource.CssClass = "inline-label"; |
lblResource.Text = "Resource:"; |
RadComboBox ddlResource = new RadComboBox(); |
ddlResource.ID = "ResourceInput"; |
//Hours |
Label lblHours = new Label(); |
lblHours.ID = "lblHours"; |
lblHours.AssociatedControlID = "HoursInput"; |
lblHours.CssClass = "inline-label"; |
lblHours.Text = "Budgeted Hours:"; |
RadTextBox txtHours = new RadTextBox(); |
txtHours.ID = "HoursInput"; |
//Work Type |
Label lblWorkType = new Label(); |
lblWorkType.ID = "lblWorkType"; |
lblWorkType.AssociatedControlID = "WorkTypeInput"; |
lblWorkType.CssClass = "inline-label"; |
lblWorkType.Text = "Work Type:"; |
RadComboBox ddlWorkType = new RadComboBox(); |
ddlWorkType.ID = "WorkTypeInput"; |
//Project |
Label lblProject = new Label(); |
lblProject.ID = "lblProject"; |
lblProject.AssociatedControlID = "ProjectInput"; |
lblProject.CssClass = "inline-label"; |
lblProject.Text = "Project:"; |
RadComboBox ddlProject = new RadComboBox(); |
ddlProject.ID = "ProjectInput"; |
//Cost Code |
Label lblCostCode = new Label(); |
lblCostCode.ID = "lblCostCode"; |
lblCostCode.AssociatedControlID = "CostCodeInput"; |
lblCostCode.CssClass = "inline-label"; |
lblCostCode.Text = "Cost Code:"; |
RadComboBox ddlCostCode = new RadComboBox(); |
ddlCostCode.ID = "CostCodeInput"; |
//Notes |
Label lblNotes = new Label(); |
lblNotes.ID = "lblNotes"; |
lblNotes.CssClass = "inline-label"; |
lblNotes.AssociatedControlID = "NotesInput"; |
lblNotes.Text = "Notes:"; |
RadTextBox txtNotes = new RadTextBox(); |
txtNotes.ID = "NotesInput"; |
txtNotes.Rows = 5; |
txtNotes.Columns = 20; |
txtNotes.Width = Unit.Percentage(95); |
txtNotes.TextMode = InputMode.MultiLine; |
//Status |
Label lblStatus = new Label(); |
lblStatus.ID = "lblStatus"; |
lblStatus.AssociatedControlID = "StatusInput"; |
lblStatus.CssClass = "inline-label"; |
lblStatus.Text = "Status:"; |
RadComboBox ddlStatus = new RadComboBox(); |
ddlStatus.ID = "StatusInput"; |
ddlStatus.Items.Add(new RadComboBoxItem("Not Started")); |
ddlStatus.Items.Add(new RadComboBoxItem("In Progress")); |
ddlStatus.Items.Add(new RadComboBoxItem("Completed")); |
//Actual Hours |
Label lblActualHours = new Label(); |
lblActualHours.ID = "lblActualHours"; |
lblActualHours.AssociatedControlID = "ActualHoursInput"; |
lblActualHours.CssClass = "inline-label"; |
lblActualHours.Text = "Actual Hours:"; |
RadTextBox txtActualHours = new RadTextBox(); |
txtActualHours.ID = "ActualHoursInput"; |
//Update Button |
LinkButton lbUpdate = new LinkButton(); |
lbUpdate.ID = "UpdateButton"; |
lbUpdate.CommandName = "Update"; |
lbUpdate.Text = "Update"; |
//Cancel Button |
LinkButton lbCancel = new LinkButton(); |
lbCancel.ID = "UpdateCancelButton"; |
lbCancel.CommandName = "Cancel"; |
lbCancel.CausesValidation = false; |
lbCancel.Text = "Cancel"; |
//Build Display |
container.Controls.Add(new LiteralControl("<div id=\"qsfexAdvEditWrapper\">")); |
container.Controls.Add(new LiteralControl("<div id=\"qsfexAdvEditInnerWrapper\">")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblDescription); |
container.Controls.Add(txtDescription); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblStartDate); |
container.Controls.Add(dpStartDate); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblEndDate); |
container.Controls.Add(dpEndDate); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblHours); |
container.Controls.Add(txtHours); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblWorkType); |
container.Controls.Add(ddlWorkType); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblResource); |
container.Controls.Add(ddlResource); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblProject); |
container.Controls.Add(ddlProject); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblCostCode); |
container.Controls.Add(ddlCostCode); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblNotes); |
container.Controls.Add(txtNotes); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblStatus); |
container.Controls.Add(ddlStatus); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lblActualHours); |
container.Controls.Add(txtActualHours); |
container.Controls.Add(new LiteralControl("<br/></div>")); |
container.Controls.Add(new LiteralControl("<div class=\"qsfexAdvEditControlWrapper\">")); |
container.Controls.Add(lbUpdate); |
container.Controls.Add(lbCancel); |
container.Controls.Add(new LiteralControl("</div></div></div>")); |
} |
Form Created event where I am successfully setting the skin of the controls inside the form
void conScheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e) |
{ |
try |
{ |
if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert) |
{ |
RadTextBox description = (RadTextBox)e.Container.FindControl("TitleTextBox"); |
description.Skin = _skin; |
RadDateInput startdate = (RadDateInput)e.Container.FindControl("StartInput"); |
startdate.Skin = _skin; |
startdate.DateFormat = conScheduler.EditFormDateFormat + " " + conScheduler.EditFormTimeFormat; |
RadDateInput enddate = (RadDateInput)e.Container.FindControl("EndInput"); |
enddate.Skin = _skin; |
enddate.DateFormat = conScheduler.EditFormDateFormat + " " + conScheduler.EditFormTimeFormat; |
RadComboBox resource = (RadComboBox)e.Container.FindControl("ResourceInput"); |
resource.Skin = _skin; |
resource.AutoPostBack = true; |
resource.Items.Add(new RadComboBoxItem("Select", "0")); |
resource = LoadResources(resource); |
resource.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(resource_SelectedIndexChanged); |
RadTextBox hours = (RadTextBox)e.Container.FindControl("HoursInput"); |
hours.Skin = _skin; |
RadComboBox worktype = (RadComboBox)e.Container.FindControl("WorkTypeInput"); |
worktype.Skin = _skin; |
worktype = LoadWorkTypes(worktype); |
RadComboBox project = (RadComboBox)e.Container.FindControl("ProjectInput"); |
project.Skin = _skin; |
project.AutoPostBack = true; |
project.Items.Add(new RadComboBoxItem("Select Resource", "0")); |
project.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(project_SelectedIndexChanged); |
RadComboBox costcode = (RadComboBox)e.Container.FindControl("CostCodeInput"); |
costcode.Skin = _skin; |
costcode.Items.Add(new RadComboBoxItem("Select Project", "0")); |
RadTextBox notes = (RadTextBox)e.Container.FindControl("NotesInput"); |
notes.Skin = _skin; |
RadComboBox status = (RadComboBox)e.Container.FindControl("StatusInput"); |
status.Skin = _skin; |
RadTextBox ahours = (RadTextBox)e.Container.FindControl("ActualHoursInput"); |
ahours.Skin = _skin; |
try |
{ |
TaskInfo task = FindTaskById(e.Appointment.ID); |
description.Text = task._subject; |
startdate.SelectedDate = conScheduler.DisplayToUtc(task._startdatetime); |
enddate.SelectedDate = conScheduler.DisplayToUtc(task._enddatetime); |
resource.SelectedValue = task._resourceid; |
hours.Text = task._hours.ToString(); |
worktype.SelectedValue = task._worktype; |
if (!string.IsNullOrEmpty(task._project) && !string.IsNullOrEmpty(task._resource)) |
{ |
project = LoadProjectsByResource(project, task._resource); |
project.SelectedValue = task._project; |
} |
if (!string.IsNullOrEmpty(task._costcode) && !string.IsNullOrEmpty(task._project)) |
{ |
costcode = LoadCostCodesByProject(costcode, task._project); |
costcode.SelectedValue = task._costcode; |
} |
notes.Text = task._notes; |
status.SelectedValue = task._status; |
ahours.Text = task._actualhours.ToString(); |
} |
catch { } |
} |
} |
catch (Exception ex) { lblError.Text = ex.ToString(); } |
} |
0
Hi Joe,
I am sorry for the misunderstanding. Now that I think I got your point, I would still refer you to the AdvancedForm user control from the AdvancedTemplates demo. You need to wrap your controls within divs with the special css classes. In the code below I have highlighted only the first few such classes, but you can search by "rs" to get the rest of them. These styles would be automaically served by the Telerik.Web.UI assembly so you dont have to register any css files explicitly unless you have set EnableEmbeddedBaseStylesheet="false". In that case you would have to register Scheduler.css from the Skins folder of your RadControls installation.
I hope this helps.
All the best,
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.
I am sorry for the misunderstanding. Now that I think I got your point, I would still refer you to the AdvancedForm user control from the AdvancedTemplates demo. You need to wrap your controls within divs with the special css classes. In the code below I have highlighted only the first few such classes, but you can search by "rs" to get the rest of them. These styles would be automaically served by the Telerik.Web.UI assembly so you dont have to register any css files explicitly unless you have set EnableEmbeddedBaseStylesheet="false". In that case you would have to register Scheduler.css from the Skins folder of your RadControls installation.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AdvancedForm.ascx.cs" Inherits="AdvancedForm" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="scheduler" TagName="ResourceControl" Src="ResourceControl.ascx" %>
<%@ Register TagPrefix="scheduler" TagName="MultipleValuesResourceControl" Src="MultipleValuesResourceControl.ascx" %>
<
div
class
=
"rsAdvancedEdit"
style
=
"position: relative"
>
<%-- Title bar. --%>
<
div
class
=
"rsAdvTitle"
>
<%-- The rsAdvInnerTitle element is used as a drag handle when the form is modal. --%>
<
h1
class
=
"rsAdvInnerTitle"
>
<%= Owner.Localization.AdvancedEditAppointment %></
h1
>
<
asp:LinkButton
runat
=
"server"
ID
=
"AdvancedEditCloseButton"
CssClass
=
"rsAdvEditClose"
CommandName
=
"Cancel"
CausesValidation
=
"false"
ToolTip='<%# Owner.Localization.AdvancedClose %>'>
<%= Owner.Localization.AdvancedClose %>
</
asp:LinkButton
>
</
div
>
<
div
class
=
"rsAdvContentWrapper"
>
<%-- Scroll container - when the form height exceeds MaximumHeight scrollbars will appear on this element--%>
<
div
class
=
"rsAdvOptionsScroll"
>
<
asp:Panel
runat
=
"server"
ID
=
"AdvancedEditOptionsPanel"
CssClass
=
"rsAdvOptions"
>
<
asp:Panel
runat
=
"server"
ID
=
"BasicControlsPanel"
CssClass
=
"rsAdvBasicControls"
OnDataBinding
=
"BasicControlsPanel_DataBinding"
>
<
telerik:RadTextBox
runat
=
"server"
ID
=
"SubjectText"
Width
=
"100%"
Label='<%# Owner.Localization.AdvancedSubject + ":" %>'
Text='<%# Eval("Subject") %>' />
<
asp:RequiredFieldValidator
runat
=
"server"
ID
=
"SubjectValidator"
ControlToValidate
=
"SubjectText"
EnableClientScript
=
"true"
Display
=
"None"
CssClass
=
"rsValidatorMsg"
/>
<
asp:Panel
ID
=
"rsTimePickersPanel"
runat
=
"server"
>
<
ul
class
=
"rsTimePickers"
>
<
li
class
=
"rsTimePick"
>
<
label
for='<%= StartDate.ClientID %>_dateInput_text'>
<%= Owner.Localization.AdvancedFrom %></
label
><%--
Leaving a newline here will affect the layout, so we use a comment instead.
--%><
telerik:RadDatePicker
runat
=
"server"
ID
=
"StartDate"
CssClass
=
"rsAdvDatePicker"
Width
=
"83px"
SharedCalendarID
=
"SharedCalendar"
Skin='<%# Owner.Skin %>' Culture='<%# Owner.Culture %>'
MinDate="1900-01-01">
<
DatePopupButton
Visible
=
"False"
/>
<
DateInput
ID
=
"DateInput2"
runat
=
"server"
DateFormat='<%# Owner.AdvancedForm.DateFormat %>'
EmptyMessageStyle-CssClass="radInvalidCss_Default" EmptyMessage=" " />
</
telerik:RadDatePicker
>
<%--
--%><
telerik:RadTimePicker
runat
=
"server"
ID
=
"StartTime"
CssClass
=
"rsAdvTimePicker"
Width
=
"65px"
Skin='<%# Owner.Skin %>' Culture='<%# Owner.Culture %>'>
<
DateInput
ID
=
"DateInput3"
runat
=
"server"
EmptyMessageStyle-CssClass
=
"radInvalidCss_Default"
EmptyMessage
=
" "
/>
<
TimePopupButton
Visible
=
"false"
/>
<
TimeView
ID
=
"TimeView1"
runat
=
"server"
Columns
=
"2"
ShowHeader
=
"false"
StartTime
=
"08:00"
EndTime
=
"18:00"
Interval
=
"00:30"
/>
</
telerik:RadTimePicker
>
</
li
>
<
li
class
=
"rsTimePick"
>
<
label
for='<%= EndDate.ClientID %>_dateInput_text'>
<%= Owner.Localization.AdvancedTo%></
label
><%--
--%><
telerik:RadDatePicker
runat
=
"server"
ID
=
"EndDate"
CssClass
=
"rsAdvDatePicker"
Width
=
"83px"
SharedCalendarID
=
"SharedCalendar"
Skin='<%# Owner.Skin %>' Culture='<%# Owner.Culture %>'
MinDate="1900-01-01">
<
DatePopupButton
Visible
=
"False"
/>
<
DateInput
ID
=
"DateInput4"
runat
=
"server"
DateFormat='<%# Owner.AdvancedForm.DateFormat %>'
EmptyMessageStyle-CssClass="radInvalidCss_Default" EmptyMessage=" " />
</
telerik:RadDatePicker
>
<%--
--%><
telerik:RadTimePicker
runat
=
"server"
ID
=
"EndTime"
CssClass
=
"rsAdvTimePicker"
Width
=
"65px"
Skin='<%# Owner.Skin %>' Culture='<%# Owner.Culture %>'>
<
DateInput
ID
=
"DateInput5"
runat
=
"server"
EmptyMessageStyle-CssClass
=
"radInvalidCss_Default"
EmptyMessage
=
" "
/>
<
TimePopupButton
Visible
=
"false"
/>
<
TimeView
ID
=
"TimeView2"
runat
=
"server"
Columns
=
"2"
ShowHeader
=
"false"
StartTime
=
"08:00"
EndTime
=
"18:00"
Interval
=
"00:30"
/>
</
telerik:RadTimePicker
>
</
li
>
<
li
class
=
"rsAllDayWrapper"
>
<
asp:CheckBox
runat
=
"server"
ID
=
"AllDayEvent"
CssClass
=
"rsAdvChkWrap"
Checked
=
"false"
/>
</
li
>
</
ul
>
</
asp:Panel
>
<
asp:RequiredFieldValidator
runat
=
"server"
ID
=
"StartDateValidator"
ControlToValidate
=
"StartDate"
EnableClientScript
=
"true"
Display
=
"None"
CssClass
=
"rsValidatorMsg"
/>
<
asp:RequiredFieldValidator
runat
=
"server"
ID
=
"StartTimeValidator"
ControlToValidate
=
"StartTime"
EnableClientScript
=
"true"
Display
=
"None"
CssClass
=
"rsValidatorMsg"
/>
<
asp:RequiredFieldValidator
runat
=
"server"
ID
=
"EndDateValidator"
ControlToValidate
=
"EndDate"
EnableClientScript
=
"true"
Display
=
"None"
CssClass
=
"rsValidatorMsg"
/>
<
asp:RequiredFieldValidator
runat
=
"server"
ID
=
"EndTimeValidator"
ControlToValidate
=
"EndTime"
EnableClientScript
=
"true"
Display
=
"None"
CssClass
=
"rsValidatorMsg"
/>
<
asp:CustomValidator
runat
=
"server"
ID
=
"DurationValidator"
ControlToValidate
=
"StartDate"
EnableClientScript
=
"false"
Display
=
"Dynamic"
CssClass
=
"rsValidatorMsg rsInvalid"
OnServerValidate
=
"DurationValidator_OnServerValidate"
/>
</
asp:Panel
>
<
asp:Panel
runat
=
"server"
ID
=
"AdvancedControlsPanel"
CssClass
=
"rsAdvMoreControls"
>
<
label
> Color: </
label
>
<!--
-->
<
telerik:RadColorPicker
ID
=
"AppointmentColorPicker"
runat
=
"server"
CssClass
=
"rsAdvResourceValue"
ShowIcon
=
"true"
PaletteModes
=
"HSV"
>
</
telerik:RadColorPicker
>
<
asp:Panel
runat
=
"server"
ID
=
"ResourceControls"
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Button"
onclick
=
"Button1_Click"
/>
<%-- RESOURCE CONTROLS --%>
<
ul
class
=
"rsResourceControls"
>
<
li
>
<!-- Resource controls should follow the convention Res[Resource Name] for ID -->
<
scheduler:ResourceControl
runat
=
"server"
ID
=
"ResRoom"
Type
=
"Room"
Label
=
"Room:"
Skin='<%# Owner.Skin %>' />
</
li
>
<
li
>
<
scheduler:MultipleValuesResourceControl
runat
=
"server"
ID
=
"ResUser"
Type
=
"User"
Label
=
"User: "
/>
</
li
>
<!-- Optionally add more ResourceControl instances here -->
</
ul
>
</
asp:Panel
>
</
asp:Panel
>
<
telerik:RadTextBox
runat
=
"server"
ID
=
"DescriptionText"
TextMode
=
"MultiLine"
Columns
=
"50"
Rows
=
"5"
Width
=
"100%"
Label='<%# Owner.Localization.AdvancedDescription + ":" %>'
Text='<%# Eval("Description") %>' />
<
asp:Panel
runat
=
"server"
ID
=
"RecurrenceCheckBoxPanel"
>
<
asp:CheckBox
runat
=
"server"
ID
=
"RecurrentAppointment"
CssClass
=
"rsAdvChkWrap"
Checked
=
"false"
Style
=
"float: none"
/>
</
asp:Panel
>
<
asp:Panel
runat
=
"server"
ID
=
"RecurrencePanel"
Style
=
"display: none;"
CssClass
=
"rsAdvRecurrencePanel"
>
<
asp:Panel
runat
=
"server"
ID
=
"RecurrencePatternPanel"
CssClass
=
"rsAdvRecurrencePatterns"
OnDataBinding
=
"RecurrencePatternPanel_DataBinding"
>
<
span
class
=
"rsAdvResetExceptions"
>
<
asp:LinkButton
runat
=
"server"
ID
=
"ResetExceptions"
OnClick
=
"ResetExceptions_OnClick"
/>
</
span
>
<
asp:Panel
runat
=
"server"
ID
=
"RecurrenceFrequencyPanel"
CssClass
=
"rsAdvRecurrenceFreq"
>
<
ul
class
=
"rsRecurrenceOptionList"
>
<
li
>
<
asp:RadioButton
runat
=
"server"
GroupName
=
"RepeatFrequency"
ID
=
"RepeatFrequencyHourly"
/></
li
>
<
li
>
<
asp:RadioButton
runat
=
"server"
GroupName
=
"RepeatFrequency"
ID
=
"RepeatFrequencyDaily"
/></
li
>
<
li
>
<
asp:RadioButton
runat
=
"server"
GroupName
=
"RepeatFrequency"
ID
=
"RepeatFrequencyWeekly"
/></
li
>
<
li
>
<
asp:RadioButton
runat
=
"server"
GroupName
=
"RepeatFrequency"
ID
=
"RepeatFrequencyMonthly"
/></
li
>
<
li
>
<
asp:RadioButton
runat
=
"server"
GroupName
=
"RepeatFrequency"
ID
=
"RepeatFrequencyYearly"
/></
li
>
</
ul
>
</
asp:Panel
>
<
asp:Panel
runat
=
"server"
ID
=
"RecurrencePatternHourlyPanel"
CssClass
=
"rsAdvPatternPanel rsAdvHourly"
Style
=
"display: none;"
>
<
div
>
<%= Owner.Localization.AdvancedEvery %>
<
telerik:RadNumericTextBox
runat
=
"server"
CssClass
=
"rsAdvInput"
Width
=
"50px"
ID
=
"HourlyRepeatInterval"
Value
=
"1"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"0"
ShowSpinButtons
=
"true"
MinValue
=
"1"
Skin='<%# Owner.Skin %>' />
<%= Owner.Localization.AdvancedHours %>
</
div
>
</
asp:Panel
>
<
asp:Panel
runat
=
"server"
ID
=
"RecurrencePatternDailyPanel"
CssClass
=
"rsAdvPatternPanel rsAdvDaily"
Style
=
"display: none;"
>
<
ul
>
<
li
>
<
asp:RadioButton
runat
=
"server"
ID
=
"RepeatEveryNthDay"
Checked
=
"true"
GroupName
=
"DailyRecurrenceDetailRadioGroup"
CssClass
=
"rsAdvRadio"
/>
<
telerik:RadNumericTextBox
runat
=
"server"
CssClass
=
"rsAdvInput"
Width
=
"50px"
ID
=
"DailyRepeatInterval"
Value
=
"1"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"0"
ShowSpinButtons
=
"true"
MinValue
=
"1"
Skin='<%# Owner.Skin %>' />
<%= Owner.Localization.AdvancedDays %>
</
li
>
<
li
>
<
asp:RadioButton
runat
=
"server"
ID
=
"RepeatEveryWeekday"
GroupName
=
"DailyRecurrenceDetailRadioGroup"
CssClass
=
"rsAdvRadio"
/>
</
li
>
</
ul
>
</
asp:Panel
>
<
asp:Panel
runat
=
"server"
ID
=
"RecurrencePatternWeeklyPanel"
CssClass
=
"rsAdvPatternPanel rsAdvWeekly"
Style
=
"display: none;"
>
<
div
>
<%= Owner.Localization.AdvancedRecurEvery %>
<
telerik:RadNumericTextBox
runat
=
"server"
CssClass
=
"rsAdvInput"
Width
=
"50px"
ID
=
"WeeklyRepeatInterval"
Value
=
"1"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"0"
ShowSpinButtons
=
"true"
MinValue
=
"1"
Skin='<%# Owner.Skin %>' />
<%= Owner.Localization.AdvancedWeeks %>
</
div
>
<
ul
class
=
"rsAdvWeekly_WeekDays"
>
<
li
>
<
asp:CheckBox
runat
=
"server"
CssClass
=
"rsAdvCheckboxWrapper"
ID
=
"WeeklyWeekDaySunday"
/></
li
>
<
li
>
<
asp:CheckBox
runat
=
"server"
CssClass
=
"rsAdvCheckboxWrapper"
ID
=
"WeeklyWeekDayMonday"
/></
li
>
<
li
>
<
asp:CheckBox
runat
=
"server"
CssClass
=
"rsAdvCheckboxWrapper"
ID
=
"WeeklyWeekDayTuesday"
/></
li
>
<
li
>
<
asp:CheckBox
runat
=
"server"
CssClass
=
"rsAdvCheckboxWrapper"
ID
=
"WeeklyWeekDayWednesday"
/></
li
>
<
li
style
=
"clear: left;"
>
<
asp:CheckBox
runat
=
"server"
CssClass
=
"rsAdvCheckboxWrapper"
ID
=
"WeeklyWeekDayThursday"
/></
li
>
<
li
>
<
asp:CheckBox
runat
=
"server"
CssClass
=
"rsAdvCheckboxWrapper"
ID
=
"WeeklyWeekDayFriday"
/></
li
>
<
li
>
<
asp:CheckBox
runat
=
"server"
CssClass
=
"rsAdvCheckboxWrapper"
ID
=
"WeeklyWeekDaySaturday"
/></
li
>
</
ul
>
</
asp:Panel
>
<
asp:Panel
runat
=
"server"
ID
=
"RecurrencePatternMonthlyPanel"
CssClass
=
"rsAdvPatternPanel rsAdvMonthly"
Style
=
"display: none;"
>
<
ul
>
<
li
>
<
asp:RadioButton
runat
=
"server"
ID
=
"RepeatEveryNthMonthOnDate"
Checked
=
"true"
GroupName
=
"MonthlyRecurrenceRadioGroup"
CssClass
=
"rsAdvRadio"
/>
<
telerik:RadNumericTextBox
runat
=
"server"
CssClass
=
"rsAdvInput"
Width
=
"50px"
ID
=
"MonthlyRepeatDate"
Value
=
"1"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"0"
ShowSpinButtons
=
"true"
MinValue
=
"1"
MaxValue
=
"31"
Skin='<%# Owner.Skin %>' />
<%= Owner.Localization.AdvancedOfEvery %>
<
telerik:RadNumericTextBox
runat
=
"server"
CssClass
=
"rsAdvInput"
Width
=
"50px"
ID
=
"MonthlyRepeatIntervalForDate"
Value
=
"1"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"0"
ShowSpinButtons
=
"true"
MinValue
=
"1"
Skin='<%# Owner.Skin %>' />
<%= Owner.Localization.AdvancedMonths %>
</
li
>
<
li
>
<
asp:RadioButton
runat
=
"server"
ID
=
"RepeatEveryNthMonthOnGivenDay"
GroupName
=
"MonthlyRecurrenceRadioGroup"
CssClass
=
"rsAdvRadio"
/>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"MonthlyDayOrdinalDropDown"
Width
=
"70px"
Skin='<%# Owner.Skin %>'
CssClass="rsAdvRecurrenceDropDown">
<%--Populated from code-behind--%>
</
telerik:RadComboBox
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"MonthlyDayMaskDropDown"
Width
=
"110px"
Skin='<%# Owner.Skin %>'
CssClass="rsAdvRecurrenceDropDown">
<%--Populated from code-behind--%>
</
telerik:RadComboBox
>
<%= Owner.Localization.AdvancedOfEvery %>
<
telerik:RadNumericTextBox
runat
=
"server"
CssClass
=
"rsAdvInput"
Width
=
"50px"
ID
=
"MonthlyRepeatIntervalForGivenDay"
Value
=
"1"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"0"
ShowSpinButtons
=
"true"
MinValue
=
"1"
Skin='<%# Owner.Skin %>' />
<%= Owner.Localization.AdvancedMonths %>
</
li
>
</
ul
>
</
asp:Panel
>
<
asp:Panel
runat
=
"server"
ID
=
"RecurrencePatternYearlyPanel"
CssClass
=
"rsAdvPatternPanel rsAdvYearly"
Style
=
"display: none;"
>
<
ul
>
<
li
>
<
asp:RadioButton
runat
=
"server"
ID
=
"RepeatEveryYearOnDate"
Checked
=
"true"
GroupName
=
"YearlyRecurrenceRadioGroup"
CssClass
=
"rsAdvRadio"
/>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"YearlyRepeatMonthForDate"
Width
=
"90px"
Skin='<%# Owner.Skin %>'>
<%--Populated from code-behind--%>
</
telerik:RadComboBox
>
<
telerik:RadNumericTextBox
runat
=
"server"
CssClass
=
"rsAdvInput"
Width
=
"50px"
ID
=
"YearlyRepeatDate"
Value
=
"1"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"0"
ShowSpinButtons
=
"true"
MinValue
=
"1"
MaxValue
=
"31"
Skin='<%# Owner.Skin %>' />
</
li
>
<
li
>
<
asp:RadioButton
runat
=
"server"
ID
=
"RepeatEveryYearOnGivenDay"
GroupName
=
"YearlyRecurrenceRadioGroup"
CssClass
=
"rsAdvRadio"
/>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"YearlyDayOrdinalDropDown"
Width
=
"70px"
Skin='<%# Owner.Skin %>'
CssClass="rsAdvRecurrenceDropDown">
<%--Populated from code-behind--%>
</
telerik:RadComboBox
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"YearlyDayMaskDropDown"
Width
=
"110px"
Skin='<%# Owner.Skin %>'
CssClass="rsAdvRecurrenceDropDown">
<%--Populated from code-behind--%>
</
telerik:RadComboBox
>
<%= Owner.Localization.AdvancedOf %>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"YearlyRepeatMonthForGivenDay"
Width
=
"90px"
Skin='<%# Owner.Skin %>'>
<%--Populated from code-behind--%>
</
telerik:RadComboBox
>
</
li
>
</
ul
>
</
asp:Panel
>
</
asp:Panel
>
<
asp:Panel
runat
=
"server"
ID
=
"RecurrenceRangePanel"
CssClass
=
"rsAdvRecurrenceRangePanel"
OnDataBinding
=
"RecurrenceRangePanel_DataBinding"
>
<
ul
>
<
li
>
<
asp:RadioButton
runat
=
"server"
ID
=
"RepeatIndefinitely"
Checked
=
"true"
GroupName
=
"RecurrenceRangeRadioGroup"
CssClass
=
"rsAdvRadio"
/>
</
li
>
<
li
>
<
asp:RadioButton
runat
=
"server"
ID
=
"RepeatGivenOccurrences"
GroupName
=
"RecurrenceRangeRadioGroup"
CssClass
=
"rsAdvRadio"
/>
<
telerik:RadNumericTextBox
runat
=
"server"
CssClass
=
"rsAdvInput"
Width
=
"50px"
ID
=
"RangeOccurrences"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"0"
ShowSpinButtons
=
"true"
MinValue
=
"1"
Skin='<%# Owner.Skin %>' />
<%= Owner.Localization.AdvancedOccurrences %>
</
li
>
<
li
class
=
"rsTimePick"
>
<
asp:RadioButton
runat
=
"server"
ID
=
"RepeatUntilGivenDate"
GroupName
=
"RecurrenceRangeRadioGroup"
CssClass
=
"rsAdvRadio"
/>
<
telerik:RadDatePicker
runat
=
"server"
ID
=
"RangeEndDate"
CssClass
=
"rsAdvDatePicker"
Width
=
"83px"
Skin='<%# Owner.Skin %>' SharedCalendarID="SharedCalendar" Culture='<%# Owner.Culture %>'>
<
DatePopupButton
Visible
=
"False"
/>
<
DateInput
ID
=
"DateInput1"
runat
=
"server"
DateFormat='<%# Owner.AdvancedForm.DateFormat %>' />
</
telerik:RadDatePicker
>
</
li
>
</
ul
>
</
asp:Panel
>
</
asp:Panel
>
<
asp:HiddenField
runat
=
"server"
ID
=
"OriginalRecurrenceRule"
/>
<
telerik:RadCalendar
runat
=
"server"
ID
=
"SharedCalendar"
Skin='<%# Owner.Skin %>'
CultureInfo='<%# Owner.Culture %>' ShowRowHeaders="false" RangeMinDate="1900-01-01" />
</
asp:Panel
>
</
div
>
<
asp:Panel
runat
=
"server"
ID
=
"ButtonsPanel"
CssClass
=
"rsAdvancedSubmitArea"
>
<
div
class
=
"rsAdvButtonWrapper"
>
<
asp:LinkButton
runat
=
"server"
ID
=
"UpdateButton"
CssClass
=
"rsAdvEditSave"
>
<
span
><%= Owner.Localization.Save %></
span
>
</
asp:LinkButton
>
<
asp:LinkButton
runat
=
"server"
ID
=
"CancelButton"
CssClass
=
"rsAdvEditCancel"
CommandName
=
"Cancel"
CausesValidation
=
"false"
>
<
span
><%= Owner.Localization.Cancel %></
span
>
</
asp:LinkButton
>
</
div
>
</
asp:Panel
>
</
div
>
</
div
>
</
asp:Panel
>
I hope this helps.
All the best,
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.
0
Joe
Top achievements
Rank 1
answered on 29 Dec 2009, 04:16 PM
Peter,
Perfect! That was exactly what I was looking for.
Thank You!
Perfect! That was exactly what I was looking for.
Thank You!