Hi..
I Am using Rad Scheduler in my web application.
I have almost done with the basic functionality, But i have a issue that is I want to display the Different value in the Subject, Description and i want an extra value using that i want to set the the CSS for the Appointment.
such as
SubjectId="1"
Subject = "Task"
Description = "This is a Task."
TypeId= 1
SubjectId="10"
Subject = "TroubleTicket"
Description = "This is a TroubleTicket."
TypeId= 2
so on radsch_AppointmentDataBound() event
I am checking following condition.
if( e.Appointment.TypeId==1)
{
e.Appointment.CssClass = "rsCategoryYellow";
}
else if (e.Appointment.TypeId== 2)
{
e.Appointment.CssClass = "rsCategoryRed";
}
else
{
e.Appointment.CssClass = "rsCategoryGreen";
}
-- right now i have used in subectid (Following code)
if( e.Appointment.Subject == Convert.ToString((int)EventType.Task))
{
e.Appointment.CssClass = "rsCategoryYellow";
}
else if (e.Appointment.Subject == Convert.ToString((int)EventType.TroubleTicket))
{
e.Appointment.CssClass = "rsCategoryRed";
}
else
{
e.Appointment.CssClass = "rsCategoryGreen";
}
-- also I m attaching my code to.
Aspx
<telerik:RadScheduler ID="radschMyCalendar" runat="server" Width="100%" DataKeyField="PrimeId"
DataStartField="StartDateTime" StartEditingInAdvancedForm="true" DataEndField="DueDateTime"
DataSubjectField="TypeId" DataDescriptionField="Description" ShowAllDayRow="true"
Culture="en-US" Height="100%" SelectedView="MonthView" AllowDelete="false" FirstDayOfWeek="Monday"
LastDayOfWeek="Sunday" OnAppointmentDataBound="radschMyCalendar_AppointmentDataBound">
<MultiDayView UserSelectable="false" />
<AdvancedForm Modal="true" />
<TimelineView UserSelectable="false" />
<AppointmentContextMenuSettings EnableDefault="true" />
<AppointmentTemplate>
<div>
<%# Eval("Subject").ToString().Replace(",", "<br/>")%>
</div>
</AppointmentTemplate>
</telerik:RadScheduler>
aspx.cs
if (objMyCalendarList != null)
{
radschMyCalendar.DataSource = objMyCalendarList;
objMyCalendarList = objMyCalendarList.FindAll(delegate(MyActivityBE obj) { return obj.StartDateTime < obj.DueDateTime; });
radschMyCalendar.DataBind();
}
else
{
radschMyCalendar.DataSource = null;
radschMyCalendar.DataBind();
}
protected void radschMyCalendar_AppointmentDataBound(object sender, SchedulerEventArgs e)
{
e.Appointment.ToolTip = e.Appointment.Description;
RadScheduler radschMyCalendar = (RadScheduler)sender;
if( e.Appointment.Subject == Convert.ToString((int)EventType.Task))
{
e.Appointment.CssClass = "rsCategoryYellow";
}
else if (e.Appointment.Subject == Convert.ToString((int)EventType.TroubleTicket))
{
e.Appointment.CssClass = "rsCategoryRed";
}
else
{
e.Appointment.CssClass = "rsCategoryGreen";
}
e.Appointment.ToolTip = e.Appointment.Description;
}
---
I have also attached some images..
So anyone can tell me that how can i able to get this functionality..
Thanx in advance.