I put an AppTemplate on my RadScheduler.
public class AppTemplate : ITemplate
{
public void InstantiateIn(Control container)
{
var subject = new Literal();
subject.DataBinding += subject_DataBinding;
container.Controls.Add(subject);
}
private static void subject_DataBinding(object sender, EventArgs e)
{
var subject = (Literal)sender;
var aptCont = (SchedulerAppointmentContainer)subject.Parent;
Appointment app = aptCont.Appointment;
var myId = app.ID.ToString().Split('_');
int idCalendar = Convert.ToInt32(myId[0]);
var calendar = new BLLCalendar().getCalendar(idCalendar);
String numAffaire;
try
{
numAffaire = calendar.Affaire.Num;
}
catch
{
//var user = new BLLUser().getUser(calendar.IdUser);
//numAffaire = user.NumeroService;
numAffaire = calendar.CodeHeure1.Libelle;
}
if (calendar.IsValider)
{
app.ForeColor = Color.Green;
}
if (calendar.IsSaisie)
{
app.ForeColor = Color.Red;
app.AllowEdit = false;
app.AllowDelete = false;
}
subject.Text = String.Format("{0} - {1}", numAffaire, calendar.Temps);
app.ToolTip = calendar.Commentaire;
app.CssClass = SchedulerCSS.getCSSHeures(calendar.CodeHeure);
}
}
With this I have questions :
- Is it possible to add the recurrence Icon or other Icons on appointment ?
- Why with some SchedulerCSS the proprety app.ForeColor = Color.Red; doesn't work ?
thank you.
PS : Q2 is great !!!!