i m using Scheduler Control. I want to change Appointment Back Colour Condition Wise
In Appointment Template i Have a Label i have Just bound it to database and through This Label Value i want to Change Appointment Back Color.
Like If Label Value = "U" Then Appointment Color ="Red"
If Label Value = "P" Then Appointment Color ="Blue"
If Label Value = "A" Then Appointment Color ="Pink"
Like This. When i use Appointment Databound Event For Colour Changing Then How can i get Appointment Template Control Field Value on Appointment Databound.
And When i Use Appointment Created Event Then that Time Label Value Is Blank.
How Can I Achive this Problem.
Some Code Sample Like As
protected
void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
{
Label lblStatus = (Label)e.Container.FindControl("lblStatus");
if (lblStatus.Text == "U")
{
e.Appointment.BackColor = System.Drawing.
Color.Yellow;
}
else if (lblStatus.Text == "A")
{
e.Appointment.BackColor = System.Drawing.
Color.Blue;
}
else if (lblStatus.Text == "P")
{
e.Appointment.BackColor = System.Drawing.
Color.Green;
}
//checkbox1.Checked = true;
}
//////////////////////////////////////////////////////// aspx
<
telerik:RadScheduler AllowInsert="false" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" OnAppointmentCreated="RadScheduler1_AppointmentCreated"
runat="server" ID="RadScheduler1" Skin="Office2007" Height="551px" CustomAttributeNames="AppointmentStatus"
Width="690px" ShowFooter="false" SelectedDate="2010-03-18" DayStartTime="07:00:00"
DayEndTime="21:00:00" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" EnableDescriptionField="true"
ShowNavigationPane="false" OnAppointmentDelete="RadScheduler1_AppointmentDelete"
DataSubjectField="1" DataStartField="1" DataEndField="1" ShowAllDayRow="false"
OnClientAppointmentContextMenuItemClicked="A" OnClientAppointmentClick="ShowExisting1"
OnTimeSlotContextMenuItemClicked="RadScheduler1_TimeSlotContextMenuItemClicked" AllowDelete="false"
OnAppointmentContextMenuItemClicked="RadScheduler1_AppointmentContextMenuItemClicked"
onnavigationcommand="RadScheduler1_NavigationCommand">
<AppointmentContextMenuSettings EnableDefault="false" />
<TimelineView UserSelectable="false" />
<AppointmentTemplate>
<%
# Eval("Subject")%>
<asp:Label ID="lblStatus" runat="server" Text=<%#Eval("AppointmentStatus") %>></asp:Label>
</AppointmentTemplate>
<
TimeSlotContextMenuSettings EnableDefault="False" />
</telerik:RadScheduler>
Please Help Me.
Thanks
Chandan Kumar.