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

How can i change the color of given appointment when choosing color using color picker from appointment dialogue RadScheduler?

2 Answers 94 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rekha Kannan
Top achievements
Rank 1
Rekha Kannan asked on 25 Jun 2010, 12:19 PM
hi,
  Im new in telerik. In RadScheduler instead of the default appointmnet window im using RadDock for customize fields.
  And  Im using ColorPicker.I want to change the given appointment color based on the ColorPicker colors, while Save or Update the      
  appointment. Can you please help me?

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 25 Jun 2010, 01:20 PM
Hi Rekha,

You can use a custom attribute to store the value of the selected color. Then again using this custom attribute you can read the value and set the appointment BackColor property in AppointmentDataBound:
protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
       {
           string colorAttribute = e.Appointment.Attributes["AppointmentColor"];
           if (!string.IsNullOrEmpty(colorAttribute))
           {
               int colorValue;
               if (int.TryParse(colorAttribute, out colorValue))
               {
                   Color appointmentColor = Color.FromArgb(colorValue);
                   e.Appointment.BackColor = appointmentColor;
                   e.Appointment.BorderColor = Color.Black;
                   e.Appointment.BorderStyle = BorderStyle.Solid;
                   e.Appointment.BorderWidth = Unit.Pixel(1);
               }
           }
           e.Appointment.ToolTip = e.Appointment.Subject + ": " + e.Appointment.Description;
       }
 

This approach is used in the Advanced Templates demo, which I recommend you use as reference.


Kind regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Chris
Top achievements
Rank 1
answered on 17 Aug 2010, 04:43 PM
Thanks for the post and the response here...solved my issue.  :-)
Tags
Scheduler
Asked by
Rekha Kannan
Top achievements
Rank 1
Answers by
Peter
Telerik team
Chris
Top achievements
Rank 1
Share this question
or