Calendar Blank

4 posts, 0 answers
  1. Blair
    Blair avatar
    22 posts
    Member since:
    Jun 2012

    Posted 22 Jun Link to this post

    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

  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 23 Jun Link to this post

    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
  3. DevCraft banner
  4. Blair
    Blair avatar
    22 posts
    Member since:
    Jun 2012

    Posted 23 Jun in reply to Ves Link to this post

    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

  5. Vladislav
    Admin
    Vladislav avatar
    275 posts

    Posted 24 Jun Link to this post

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