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

text color issue

8 Answers 90 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lu
Top achievements
Rank 1
Lu asked on 31 Jan 2012, 04:57 PM
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.

8 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 06 Feb 2012, 10:28 AM
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 >>
0
Lu
Top achievements
Rank 1
answered on 06 Feb 2012, 11:04 AM
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;
....
}
0
Accepted
Todor
Telerik team
answered on 06 Feb 2012, 03:44 PM
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 >>
0
Lu
Top achievements
Rank 1
answered on 08 Feb 2012, 11:06 AM
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.
0
Accepted
Todor
Telerik team
answered on 10 Feb 2012, 10:48 AM
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 >>
0
Ahmed
Top achievements
Rank 1
answered on 25 May 2015, 10:54 PM
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 ?
0
Pavel R. Pavlov
Telerik team
answered on 28 May 2015, 08:54 AM
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
0
Ahmed
Top achievements
Rank 1
answered on 29 May 2015, 05:25 PM
Thanks Pavel it is now solved
Tags
Calendar
Asked by
Lu
Top achievements
Rank 1
Answers by
Todor
Telerik team
Lu
Top achievements
Rank 1
Ahmed
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Share this question
or