I'm using a Rad Scheduler. Setting the datasource through programming. In the appointment template I've defined 5 labels. For each day the appointment template would carry these 5 labels. However there will be difference in the data it carries and the formatting of the labels too will be different for different criteria. I'm able to get/set the data, but not able to do the formatting.
Given below is the aspx syntax.
However In addition to this I would like to do formatting on the labels based on certain criteria. For example for the label "lblTest" need to set the font color to Red, set the visible property of the label to "true/false", etc............. Basically I need a way to find out the control within the appointment template.
I'm unable to do this. Appreciate if some one could let me know how to achieve this (please provide with some code sample)
Thank you.
Given below is the aspx syntax.
<telerik:RadScheduler ID="RadScheduler2" runat="server" DataEndField="DutyEnd" |
DataKeyField="Id" DataStartField="DutyStart" CustomAttributeNames="HoursPerDay" |
DataSubjectField="Date" |
onappointmentcommand="RadScheduler2_AppointmentCommand" |
onappointmentdatabound="RadScheduler2_AppointmentDataBound" |
onformcreated="RadScheduler2_FormCreated"> |
<AppointmentTemplate> |
<asp:Label Text='<%# Bind("HoursPerDay") %>' runat="server" ID="lblTest"></asp:Label><br /> |
<asp:Label Text="This is a test2" runat="server" ID="Label8"></asp:Label><br /> |
<asp:Label Text="This is a test3" runat="server" ID="Label9"></asp:Label><br /> |
<asp:Label Text="This is a test4" runat="server" ID="Label10"></asp:Label><br /> |
<asp:Label Text="This is a test5" runat="server" ID="Label11"></asp:Label><br /> |
</AppointmentTemplate> |
</telerik:RadScheduler> |
On code behind I'm able to set the value as shown below.
protected void RadScheduler2_AppointmentDataBound(object sender, SchedulerEventArgs e) |
{ |
e.Appointment.Attributes["HoursPerDay"] = "Value from DB"; |
} |
However In addition to this I would like to do formatting on the labels based on certain criteria. For example for the label "lblTest" need to set the font color to Red, set the visible property of the label to "true/false", etc............. Basically I need a way to find out the control within the appointment template.
I'm unable to do this. Appreciate if some one could let me know how to achieve this (please provide with some code sample)
Thank you.