Disabling the Year view

2 posts, 1 answers
  1. FS
    FS avatar
    17 posts
    Member since:
    Mar 2012

    Posted 01 Dec 2016 Link to this post

    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

     

     

     

  2. Answer
    Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    568 posts

    Posted 05 Dec 2016 Link to this post

    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
Back to Top