Hello,
I'm testing the new Q1 2011 ASP.NET pack. And it looks great. :)
I have a problem on the RadScheduler component.
In the page_load I use :
And it refer to this code :
public class AppTemplate : ITemplate
{
public void InstantiateIn(Control container)
{
var recurrenceIcon = new WebControl(HtmlTextWriterTag.Div);
recurrenceIcon.DataBinding += RecurrenceIcon_DataBinding;
container.Controls.Add(recurrenceIcon);
var subject = new Literal();
subject.DataBinding += Subject_DataBinding;
container.Controls.Add(subject);
}
private static void RecurrenceIcon_DataBinding(object sender, EventArgs e)
{
var recurrence = (WebControl)sender;
var aptCont = (SchedulerAppointmentContainer)recurrence.Parent;
Appointment app = aptCont.Appointment;
var idCalendar = Convert.ToInt32(app.ID);
var calendar = BLLCalendar.GetCalendar(idCalendar);
if (calendar.IsValider)
{
recurrence.CssClass = "RadSchedulerValide";
}
if (calendar.IsSaisie)
{
recurrence.CssClass = "RadSchedulerSaisie";
}
}
private static void Subject_DataBinding(object sender, EventArgs e)
{
var subject = (Literal)sender;
var aptCont = (SchedulerAppointmentContainer)subject.Parent;
Appointment app = aptCont.Appointment;
var idCalendar = Convert.ToInt32(app.ID);
var calendar = BLLCalendar.GetCalendar(idCalendar);
app.CssClass = SchedulerCSS.getCSSHeures(calendar.CodeHeure);
String numAffaire, com;
try
{
numAffaire = calendar.Affaire.Num;
com = calendar.Affaire.Libelle;
}
catch
{
numAffaire = calendar.CodeHeure1.Libelle;
com = "";
}
if (calendar.IsSaisie || calendar.IsValider)
{
app.AllowEdit = false;
app.AllowDelete = false;
}
subject.Text = String.Format("{0} - {1}", calendar.Temps, numAffaire);
app.ToolTip = com;
if (calendar.Commentaire != "")
{
app.ToolTip += " Com :" + calendar.Commentaire;
}
}
}
With the previous version this code was working just fine. With this, I can put an icon infront of the appointment (Like in the picture).
But now, with the 2011 Q1, when I want to interact with an appointment, I have this message :
And if I remove the
RadSchedulerPlanning.AppointmentTemplate = new AppTemplate();
It's working (The CRUD), but without the template!
Is their a new way to use templates?
Thank you
Jean-Yves