Different color on different appointment

3 posts, 1 answers
  1. Xue
    Xue avatar
    2 posts
    Member since:
    Feb 2013

    Posted 19 Feb 2013 Link to this post

    protected void Page_Load(object sender, EventArgs e)
            {
    EBCRequest EBCRequest = new EBCRequest();
                var dataSource = EBCRequest.GetValidEBCRequest((int)Region.DBB);
     
                if (dataSource.Count > 0)
                {
                    this.RadScheduler2.DataSource = dataSource;
                    this.RadScheduler2.DataBind();
                    foreach (RequestModel request in dataSource)
                    {
     
                        RadScheduler2.AppointmentDataBound +=
    new AppointmentDataBoundEventHandler(RadScheduler2_AppointmentDataBound);
                        
                    }
                    
                    this.RadScheduler2.ReadOnly = true;
                    this.RadScheduler2.Rebind();
     
                     
                     
                }
                if (!IsPostBack)
                {
                    this.lblUserName.Text = this.LoginUser.FullName;
                }
            }
     
            void RadScheduler2_AppointmentDataBound(object sender, SchedulerEventArgs e)
            {
                if (e.Appointment.Resources.GetResourceByType("EventType") != null)
                {
     
                    switch (e.Appointment.Resources.GetResourceByType("EventType").Text)
                    {
                        case "Plant tour Catawba":
                            e.Appointment.BackColor = System.Drawing.Color.Blue;
                            break;
                        case "Plant tour Claremont":
                            e.Appointment.BackColor = System.Drawing.Color.Yellow;
                            break;
                        default:
                            break;
                    }
                }
            }

    How can i go in RadScheduler2_AppointmentDataBound while debugging?



  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Feb 2013 Link to this post

    Hi Xue,

    Please take a look at  the <ResourceStyles> section in the markup code where you can define style for each type and text property.
    Check the following demo where it has been implemented.Hope this helps.
    Scheduler / Defining Resources

    Thanks,
    Princy.
  3. Xue
    Xue avatar
    2 posts
    Member since:
    Feb 2013

    Posted 19 Feb 2013 Link to this post

    Thank you.
Back to Top