11 Answers, 1 is accepted
i want add some info to my earlier post,
For IOS i want to add up and down swipe, currently it is using left and right swipe.
Thanks,
Siva
The iOS calendar supports several transitions to switch between months. To change the orientation of the default transition you need to set the TransitionIsVertical property of the TKCalendarMonthPresenter to true. Here is a simple code snipped of how you can achieve this:
var calendarPresenter = calendarView.Presenter
as
TKCalendarMonthPresenter;
if
(calendarPresenter !=
null
)
{
calendarPresenter.TransitionIsVertical =
true
;
}
You can find more information about the calendar transitions in our documentation - link
I hope I've been helpful.
Nikolay
Progress Telerik
Hi,
I am using RadCalendar in Xamarin forms, I want the calendar transition as vertical for the month view. Is it possible to get vertical scroll transition in Xamarin forms using RadCalendar?
The control reference is here: https://docs.telerik.com/devtools/xamarin/controls/calendar/calendar-overview
Please suggest.
Nikolay's code snippet shows how to change the scrolling direction of the calendar. Since you're using Xamarin.Forms and the TransitionIsVertical property is on the native iOS TKCalendar control, you'll need to set it using a Xamarin Custom Renderer or Xamarin Effect.
Custom Renderer
You can see an example in the RadCalendar's iOS Custom Renderer article.
Note that because Customer Renderers are a general Xamarin.Forms topic and not directly related to the UI for Xamarin feature, we do not have documentation for it. However, you can find a in-depth tutorials and walk-throughs in the Xamarin Custom Renderer documentation.
Effect
You could also use a Xamarin Effect to access the native control's properties, see the Creating an Effect Xamarin.Forms documentation for more information and how to get started.
Once you've set up your Effect classes, you could use the OnAttached method of the Effect to set the value:
[assembly: ResolutionGroupName(
"MyCompanyName"
)]
[assembly: ExportEffect(
typeof
(ScrollDirectionEffect),
"ScrollDirectionEffect"
)]
namespace
CalendarWithXamarinEffect.iOS.Effects
{
public
class
ScrollDirectionEffect : PlatformEffect
{
protected
override
void
OnAttached()
{
try
{
var tkCalendar = Control
as
TKCalendar;
if
(tkCalendar?.Presenter
is
TKCalendarMonthPresenter calendarPresenter)
{
calendarPresenter.TransitionIsVertical =
true
;
}
}
catch
(Exception ex)
{
Console.WriteLine(
"Cannot set property on attached control. Error: "
, ex.Message);
}
}
protected
override
void
OnDetached()
{
// not used
}
}
}
and eventually in the Xamarin.Forms app, you can use the effect:
<
telerikInput:RadCalendar
x:Name
=
"calendar"
>
<
telerikInput:RadCalendar.Effects
>
<
effects:ScrollDirectionEffect
/>
</
telerikInput:RadCalendar.Effects
>
</
telerikInput:RadCalendar
>
Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Thanks Lance for the solution. Its working as expected now.
I just want to ask one more question, please suggest.
In xamarin forms RadCalendar, I want to customize the selected cell, I mean by default the selected date displays as a highlighted with a blue colored circle but instead of circle, I want it to be get highlighted with some another color and shape. For example: The selected date should be display as a rectange instead of circle and its color should be green instead of blue. I want this customization for IOS platform only.
Attached Image is for the reference.
Looking for the similar output.
Take a look at the iOS Custom Renderer article for how to access the native calendar to apply custom styling. Additionally, the native iOS Calendar customization article to see how to access certain parts of the control. Lastly, you can look at examples of the RadCalendar and TKCalendarView in the Developer Focused Examples.
As far as implementing your specific requests, you can reach out to our Custom App / Custom Development partners to get assistance with your custom styling requirements.
Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
I wanted to follow up with you to show you where to look in the SDKBrowser demo to find the custom renderer that configures the cell styles. Here's a screenshot to guide you:
Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Sorry to hijack this thread, but I need the same for Android. I need the calendar to scroll left to right, not up and down. Can you help with an Effect, or at least the properties in the native control that I would need to set?
Thank you.
I have found the documentation on the Android Custom Renderers and Android Native control information and have what I need.
Thank you.