This is a migrated thread and some comments may be shown as answers.

Different color on different appointment

2 Answers 78 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Xue
Top achievements
Rank 1
Xue asked on 20 Feb 2013, 02:39 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 20 Feb 2013, 04:33 AM
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.
0
Xue
Top achievements
Rank 1
answered on 20 Feb 2013, 05:01 AM
Thank you.
Tags
Scheduler
Asked by
Xue
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Xue
Top achievements
Rank 1
Share this question
or