Change Appointments back color

7 posts, 1 answers
  1. Tiago
    Tiago avatar
    25 posts
    Member since:
    Aug 2009

    Posted 15 Oct 2009 Link to this post

    Dear friends,

    I have a read only RadScheduler, and i need to change the backcolor of it when i have text in one those fields.
    For example, the default backcolor is blue, but when one of the dataset fields contains some text, i need to change the backcolor to red.

    Thank you.
  2. Tiago
    Tiago avatar
    25 posts
    Member since:
    Aug 2009

    Posted 15 Oct 2009 Link to this post

    Dear friends,

    I found a very simple solution.

    Using the BackgroundId you can easily change the appointments backcolor.

    For example:
    appointmentMappingInfo.BackgroundId = "state";
    You can add the field state(int) with the correspondent number ... i found that the number 2 is the red, 11 is yellow and 4 is green!

    Good luck to you all!!
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Answer
    Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 21 Oct 2009 Link to this post

    Hi Tiago Pinho,

    If you want to change appointment background, you can use the Background and BackgroundID properties. The background property points to the AppointmentBackground enumeration with values such as Personal, Business, None, PhoneCall. Every value in the AppointmentBackground has a different color representation for the appointments.

    I hope this helps.

    All the best,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. shinu rag
    shinu rag avatar
    48 posts
    Member since:
    Feb 2010

    Posted 02 Apr 2010 Link to this post

    Hi Boyko..
    can i set appointment color by using RGB code
  6. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 07 Apr 2010 Link to this post

    Hello shinu rag,

    Thank you for writing.
     
    Unfortunately, we do not have way to add custom Background, but you could replace some of the existing background colors. The following code snippet represents how to implement it:
     
    AppointmentBackgroundInfo appointmentBackgroundInfoOld = this.radScheduler1.Backgrounds[5] as AppointmentBackgroundInfo;
    AppointmentBackgroundInfo appointmentBackgroundInfoNew = new AppointmentBackgroundInfo(appointmentBackgroundInfoOld.Id, appointmentBackgroundInfoOld.DisplayName, Color.Cyan);
    this.radScheduler1.Backgrounds[5] = appointmentBackgroundInfoNew;
     
    The existing background Ids are between 1 and 11.

    If you have additional question feel free to ask.

    Sincerely yours,
    Dobry Zranchev
    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.
  7. Xavier Soares
    Xavier Soares avatar
    39 posts
    Member since:
    Jun 2008

    Posted 05 Jan 2011 Link to this post

    Hello,

    Using the above code, the font color is also changed to background color.

    Is it possible to change the background color and keep the text/details font color of the appointment or even change it to a new one? For instance change background color to black and text color to white.

    Best regards


  8. Xavier Soares
    Xavier Soares avatar
    39 posts
    Member since:
    Jun 2008

    Posted 05 Jan 2011 Link to this post

    Solved! Just added a few lines of code:

    Dim AtrasadoInfoOld As AppointmentBackgroundInfo = TryCast(Me.RadScheduler1.Backgrounds(6), AppointmentBackgroundInfo)
    Dim AtrasadoInfoNew As New AppointmentBackgroundInfo(AtrasadoInfoOld.Id, AtrasadoInfoOld.DisplayName, Color.Yellow)
    AtrasadoInfoNew.ForeColor = Color.Black
    AtrasadoInfoNew.BackColor = Color.Yellow
    AtrasadoInfoNew.BackColor2 = Color.Yellow
    Me.RadScheduler1.Backgrounds(6) = AtrasadoInfoNew


    Best
Back to Top
UI for WinForms is Visual Studio 2017 Ready