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

Calendar Blank

3 Answers 21 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Blair
Top achievements
Rank 1
Blair asked on 22 Jun 2016, 01:08 PM

I'm trying to get the calendar to display within a ContentPage using code behind. I'm not using XAML. The display is completely blank. What am I missing?

 

public class CalendarPage : ContentPage
{
public CalendarPage ()
{
            Content = new RadCalendar() 
            { 
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand, 
                DisplayDate = DateTime.Today,
                BackgroundColor = Color.Navy,
                GridLinesColor = Color.White,
            };
                
}
}

 

Thanks,

 

Blair

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 23 Jun 2016, 02:15 PM
Hi Blair,

One possible reason for such behavior is missing renderer registration. You need to add the following line in your Android project, as described in our Calendar Getting Started page.
[assembly: Xamarin.Forms.ExportRenderer(typeof(Telerik.XamarinForms.Input.RadCalendar), typeof(Telerik.XamarinForms.InputRenderer.Android.CalendarRenderer))]


Best regards,
Ves
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
Blair
Top achievements
Rank 1
answered on 23 Jun 2016, 02:21 PM

I did this in the MainActivity.cs as it suggested.

using System;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Xamarin.Forms.Platform.Android;



namespace SalesnetRest.Droid
{
/// <summary>
/// Main Class
/// </summary>
    [assembly: Xamarin.Forms.ExportRenderer(typeof(Telerik.XamarinForms.Input.RadCalendar), typeof(Telerik.XamarinForms.InputRenderer.Android.CalendarRenderer))]
[Activity (Label = "Salesnet CRM", Icon = "@drawable/Icon", MainLauncher = false, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation,Theme = "@style/AppTheme",ScreenOrientation=ScreenOrientation.FullSensor)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity

0
Vladislav
Telerik team
answered on 24 Jun 2016, 09:03 AM
Hi Blair,

I am assuming that this suggestion does not fix the problem?

If this is the case, i.e. the calendar is still blank, is it possible to send us your project (or just the relevant part of it) in order to investigate it locally?

Thank you in advance.

Regards,
Vladislav
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
Blair
Top achievements
Rank 1
Answers by
Ves
Telerik team
Blair
Top achievements
Rank 1
Vladislav
Telerik team
Share this question
or