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

TrySetViewMode always returns false

3 Answers 73 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Fabio
Top achievements
Rank 1
Fabio asked on 30 Apr 2015, 04:43 AM

Hello

 I am using RadCalendar Component and I am setting the TrySetViewMode to CalendarViewMode.Year but the method is always returning false. I am using Xamarin forms and testing with an Android device.

 

    public YearCalendarView()
        {
            StackLayout mainView = new StackLayout
            {
                Padding = 0,
                Spacing = 0,
            };

            CustomizeNavigationBar(mainView);

            RadCalendar calendar = new RadCalendar
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
            };

            bool setView = calendar.TrySetViewMode(CalendarViewMode.Year);

            Console.WriteLine(setView);

            mainView.Children.Add(calendar);

            Content = mainView;
        }

3 Answers, 1 is accepted

Sort by
0
Fabio
Top achievements
Rank 1
answered on 30 Apr 2015, 05:17 AM

Mhhhmm never mind, calling the method inside OnAppearing did the thing.

 

protected override void OnAppearing()
        {
            base.OnAppearing();

            bool setView = calendar.TrySetViewMode(CalendarViewMode.Year);

            Console.WriteLine(setView);
        }

0
lyndon
Top achievements
Rank 1
answered on 18 Nov 2015, 10:07 PM
Thanks for posting this. I would really like to see better documentation for this product.     
0
Rosy Topchiyska
Telerik team
answered on 23 Nov 2015, 03:47 PM
Hello,

Thank you for the feedback. We have added new events that occur when the native control is ready and it is safe to call methods that update the calendar view mode. We have also updated our documentation: Calendar View Mode

Please, let us know if you have any other questions.

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