text color issue

9 posts, 2 answers
  1. Lu
    Lu avatar
    3 posts
    Member since:
    Jan 2012

    Posted 31 Jan 2012 Link to this post

    Hi,
    when I set background color of calendar to white DayNames will disapper, because they have white font color. The same issue is with days from previous or next month - they are not visible. When I change foreground color of calendar these texts are not affected.

    How can I change color of these values and make them visible?

    Thank you very much.
  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 06 Feb 2012 Link to this post

    Hello Lu,

    Thank you for your interest in RadCalendar.

    You can read a lot of information for our controls and the RadCalendar in particular in our online documentation. Here you can see how you can define your own data template for each of the dates. So in your case you need to change the Foreground of the TextBlock with Text property set to {Binding Text} to the color you want so that it is visible on the white background.

    All the best,
    Todor
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Lu
    Lu avatar
    3 posts
    Member since:
    Jan 2012

    Posted 06 Feb 2012 Link to this post

    Hi, I'm using SelectTemplate
    But I don't know how to determine, that current item is from different month.

    My code is like this:


    public override DataTemplate SelectTemplate(object item, DependencyObject container)
     {
                CalendarButtonContentInfo info = item as CalendarButtonContentInfo;
                CalendarButton button = container as CalendarButton;
    ....
    }
  5. Answer
    Todor
    Admin
    Todor avatar
    778 posts

    Posted 06 Feb 2012 Link to this post

    Hello Lu,

    You can use the CalendarButton's IsFromTheCurrentView property. When the current item is from a different month, it is false.

    All the best,
    Todor
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Lu
    Lu avatar
    3 posts
    Member since:
    Jan 2012

    Posted 08 Feb 2012 Link to this post

    Great! That solved my issue with days in calendar. Can I use template for DayNames above the calendar? They also have white foreground, so they re not visible now.
  7. Answer
    Todor
    Admin
    Todor avatar
    778 posts

    Posted 10 Feb 2012 Link to this post

    Hi Lu,

    Yes, you can check if the ButtonType of the CalendarButton is WeekName:

    CalendarButton button = container as CalendarButton;
    if (button.ButtonType == CalendarButtonType.WeekName)
    {
        return SpecialTemplate;
    }


    Regards,
    Todor
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  8. Ahmed
    Ahmed avatar
    5 posts
    Member since:
    May 2014

    Posted 25 May 2015 in reply to Todor Link to this post

    tI face the same problem but i couldnt resolve it after what mentioned above. Can you give me sample to template which force days name and previous company days number to appear on white theme ?
  9. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 28 May 2015 Link to this post

    Hello Ahmed,

    I already answered to this question in the other thread you started. Please check my answer there and let us know if you need any further assistance.

    Also, I would like to kindly ask you to keep the communication in the other thread.

    Regards,
    Pavel R. Pavlov
    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
  10. Ahmed
    Ahmed avatar
    5 posts
    Member since:
    May 2014

    Posted 29 May 2015 Link to this post

    Thanks Pavel it is now solved
Back to Top
DevCraft banner