Changing background color for each appointment in radscheduler

10 posts, 0 answers
  1. good
    good avatar
    1 posts
    Member since:
    Feb 2011

    Posted 28 Feb 2011 Link to this post

    Can I change the background color of the appointment according to my database info.

     

    For example:

     

    If am having several category

    Category 1

    Category 2

    Category 3

    Category 4

     

    I want category 1 appointment in the scheduler to be blue\

    Category 2 green

    Category 3 red

    Category 4 yellow

     

    By the way am just retrieving the data from my database.

     

    Thanks in advance

  2. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 02 Mar 2011 Link to this post

    Hi good,

    Thank you for writing.

    You are able to add your own background in the Backgrounds collection of the RadScheduler. Each background info has an Id property that should be unique. If you create an appointment and set its BackgroundId property to your custom background, the appointment will be painted in the colors of the custom background. You can find the available documentation about this topic here.

    If you have other related questions, feel free to write back.

    Best wishes,
    Dobry Zranchev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for WinForms is Visual Studio 2017 Ready
  4. khalid
    khalid avatar
    7 posts
    Member since:
    Jul 2015

    Posted 02 Oct 2015 in reply to good Link to this post

    Hi,

     

    Have you got answer of your query i have same problem. Can you please pass me your code.

    thanks.

  5. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 05 Oct 2015 Link to this post

    Hello Khalid,

    Thank you for writing.

    AppointmentElement's back color is determined by the selected Background. However, in order to customize the color, you can use the AppointmentFormatting event and specify what is the desired color:
    private void radScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
    {
        e.AppointmentElement.DrawFill = true;
        e.AppointmentElement.BackColor = Color.Aqua;
        e.AppointmentElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
    }

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  6. Aref
    Aref avatar
    18 posts
    Member since:
    Sep 2015

    Posted 21 Nov 2015 in reply to Dess Link to this post

    Hi 
    I have got problem to retrieve appointment background color, every time I save an appointment it's background color change to default value. I am also sure that the mapping is right because the background ID is saved correctly. Could you please help me with this problem.
  7. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 23 Nov 2015 Link to this post

    Hello Aref,

    Thank you for writing.

    The SchedulerMapping class is responsible for mapping a single property from the data source to a scheduler property, which allows you to specify convert callback methods in order to convert values to and from the data source if needed. Please refer to the following help article which demonstrates how to convert the BackgroundId from database: http://www.telerik.com/help/winforms/scheduler-data-binding-scheduler-mapping.html

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  8. Aref
    Aref avatar
    18 posts
    Member since:
    Sep 2015

    Posted 23 Nov 2015 in reply to Dess Link to this post

    Dear Dess
    Thanks for your reply but my problem still remains, I create those functions but when I load my scheduler appointments, their background color are set to None, I should mentioned that I put those functions on my form constructor's and  when I save appointments they background are correct. 
  9. Aref
    Aref avatar
    18 posts
    Member since:
    Sep 2015

    Posted 23 Nov 2015 in reply to Dess Link to this post

    Dear Dess
    I should edit my last post that I put recalling to those functions in my form constructor's and load event.
    Sincerely yours
    Aref

  10. Aref
    Aref avatar
    18 posts
    Member since:
    Sep 2015

    Posted 23 Nov 2015 in reply to Dess Link to this post

    Dear Dess
    Sorry for bothering you to much with my posts, please ignore my post, my problem solved.
    Thanks for your help.

    Sincerely yours 
    Aref

  11. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 26 Nov 2015 Link to this post

    Hello Aref,

    Thank you for writing back.

    I am glad that the problem you were facing is now resolved. If you have any additional questions, please let me know.

    Regards,
    Dess
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready