This is a migrated thread and some comments may be shown as answers.
Disabling the Year view
1 Answer 27 Views
This is a migrated thread and some comments may be shown as answers.
FS
Top achievements
Rank 1
FS asked on 01 Dec 2016, 02:26 PM

Hi:

When you display the calendar as a Month view and the user does a double click inside a day cell, the calendar changes the view to Year view.  Is there a way to disable or hide the Year view, so the user would never access to that view.

Thanks in advanced.

David

 

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosy Topchiyska
Telerik team
answered on 05 Dec 2016, 10:19 AM
Hello,

Thank you for contacting us.

To disable the calendar gestures on Android, you have to use the native calendar GestureManager. You can do this with a custom renderer:
public class CustomCalendarRenderer : Telerik.XamarinForms.InputRenderer.Android.CalendarRenderer
{
    protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<RadCalendar> e)
    {
        base.OnElementChanged(e);
        this.Control.GestureManager.SetDoubleTapToChangeDisplayMode(false);
    }
}

And don't forget to replace the default renderer with the custom one:

[assembly: ExportRenderer(typeof(Telerik.XamarinForms.Input.RadCalendar), typeof(CustomCalendarRenderer))]

You can read more about the native gestures manager here.
 
I hope this helps.

Regards,
Rosy Topchiyska
Telerik by Progress
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
Asked by
FS
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or