4 Answers, 1 is accepted
0
Hello Ian,
You can style most of the element properties within XamarinForms (see Styling).
However, to change layout, you'll need to use a custom renderer and access the native Android CalendarView.
The Android Custom Renderer and Android CalendarView Customizations article (see "SetTextPosition" method, this would be TextPosition in C#) will help you set that up.
If you have any trouble implementing it, reply back with your custom renderer class and I'll investigate directly.
Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
You can style most of the element properties within XamarinForms (see Styling).
However, to change layout, you'll need to use a custom renderer and access the native Android CalendarView.
The Android Custom Renderer and Android CalendarView Customizations article (see "SetTextPosition" method, this would be TextPosition in C#) will help you set that up.
If you have any trouble implementing it, reply back with your custom renderer class and I'll investigate directly.
Regards,
Lance | Tech Support Engineer, Sr.
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
0
Ian
Top achievements
Rank 1
answered on 01 Aug 2018, 02:51 PM
Hi Lance,
I got this working...
protected
override
void
OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
{
base
.OnElementChanged(e);
var filter =
new
CalendarDayCellFilter
{
CellType = Com.Telerik.Widget.Calendar.CalendarCellType.Date
};
var style =
new
CalendarDayCellStyle
{
Filter = filter
TextPosition =
new
Java.Lang.Integer(4 | 8)
};
Control.AddDayCellStyle(style);
}
But how does one access CalendarElement.AlignRight given that it's not a static? At present, I'm using raw integers.
0
Hello Ian,
You should be able to use explicit conversion, try the following:
Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
You should be able to use explicit conversion, try the following:
using
Com.Telerik.Widget.Calendar;
...
var style =
new
CalendarDayCellStyle
{
Filter = filter,
TextPosition = (Java.Lang.Integer)(CalendarElement.CenterHorizontal | CalendarElement.CenterVertical)
};
Regards,
Lance | Tech Support Engineer, Sr.
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
0
Ian
Top achievements
Rank 1
answered on 01 Aug 2018, 03:17 PM
Oh yes, that works. Thanks.