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

How does one call CalendarTextElement.SetTextColor?

3 Answers 27 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 13 Sep 2018, 12:16 PM

I have a subclass of CalendarDayCell on Android and I'm trying to set the text color in an override of UpdateTextColor. The method takes two integers. What do they do? I've tried setting both to my desired color but the text is always black.

3 Answers, 1 is accepted

Sort by
0
Ian
Top achievements
Rank 1
answered on 13 Sep 2018, 12:52 PM
I've also tried assigning directly to TextColor but again no effect.
0
Ian
Top achievements
Rank 1
answered on 13 Sep 2018, 02:08 PM

I did...

protected override void UpdateTextColor()
{
    int color = ...
 
    SetTextColor(color, color);
 
    base.UpdateTextColor();
}
0
Didi
Telerik team
answered on 14 Sep 2018, 12:41 PM
Hi Ian,

Thank you for the provided code.

Indeed, the SetTextColor method takes two integers - first one is used to set the enabled textcolor and the second one is used to set the disabled textcolor of the cell.

In order to customize the textcolor of the daycell you could use the approach below: 
Define the RadCalendar in XAML:
<telerikInput:RadCalendar x:Name="calendar" />
and in code behind set the textcolor of the daycell using the following snippet:
this.calendar.DayCellStyle = new CalendarCellStyle
{
TextColor = Color.Green
};

If the approach above is not suitable for you, could you please give us more details on your setup and what do you want to achieve using custom daycell scenario?

Looking forward to your reply.

Regards,
Didi
Progress 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
Tags
Calendar & Scheduling
Asked by
Ian
Top achievements
Rank 1
Answers by
Ian
Top achievements
Rank 1
Didi
Telerik team
Share this question
or