I have an issue using RadCalendar.dayrender event and want to add some control into the cell based on some condition.Every thing works fine. I want the content inside the cell to left alligned. but i am unable to do it. Here is my code.
protected void ProcessDayEvent(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
{
if (Session["MonthlyBooking"] != null)
{
DataTable DtMonthlyBooking = (DataTable)Session["MonthlyBooking"];
DateTime CurrentDate = e.Day.Date;
DataRow[] r = DtMonthlyBooking.Select("Date='" + CurrentDate + "'");
if (r.Length > 0)
{
TimeSpan ts = Convert.ToDateTime(r[0]["startTime"].ToString()).TimeOfDay;
int shour = ts.Hours;
int sm = ts.Minutes;
ts =
Convert.ToDateTime(r[0]["EndTime"].ToString()).TimeOfDay;
int Ehour = ts.Hours;
int Em = ts.Minutes;
e.Cell.Text = shour.ToString() +
":" + sm.ToString() + "-" + Ehour.ToString() + ":" + Em.ToString() ;
e.Cell.HorizontalAlign = HorizontalAlign.Left;
}
}
}
I have also tried to assign some Css class as
e.Cell.Text = shour.ToString() + ":" + sm.ToString() + "-" + Ehour.ToString() + ":" + Em.ToString() ;
e.Cell.CssClass="selected"
and
.selected
{
background-color: #B5CCEA;
text-align: left;
padding-left: 0px;
margin-left: 0;
height: 10px;
}
in aspx page.
but it is also not working.Plz help me out.
Thanks in Advance.