This is a migrated thread and some comments may be shown as answers.
How to style TKCalendarMonthTitleCell
3 Answers 16 Views
This is a migrated thread and some comments may be shown as answers.
Benjamin
Top achievements
Rank 1
Benjamin asked on 11 Oct 2016, 01:35 PM

I would like to style or remove the title bar over the calendar, where the month name appears.

It is a TKCalendarMonthTitleCell.

I can't find any property to style it

Any directions ?

 

3 Answers, 1 is accepted

Sort by
0
Emily
Top achievements
Rank 1
answered on 11 Oct 2016, 03:27 PM

I removed it with custom renderers - 

ios:

public class OverrideCalendarRenderer : Telerik.XamarinForms.InputRenderer.iOS.CalendarRenderer
{
    protected override void OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
    {
        base.OnElementChanged(e);
        if (Control.Presenter is TKCalendarMonthPresenter)
        {
            (Control.Presenter as TKCalendarMonthPresenter).TitleHidden = true;
        }
    }
}

android:

public class OverrideCalendarRenderer : CalendarRenderer
{
    protected override void OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
    {
        base.OnElementChanged(e);
        Control.ShowTitle = false;
    }
}

0
Andriy
Top achievements
Rank 1
answered on 28 Jun 2017, 07:06 AM

Hi all!

I can't find solution for issue with changing height of TKCalendarMonthTitleCell. How to do that?

0
Nikolay Demirev
Telerik team
answered on 30 Jun 2017, 11:01 AM
Hi Andriy,

You could use the following code snippet to set the desired height of the TKCalednarMonthTitleCell:
[assembly: ExportRenderer(typeof(RadCalendar), typeof(OverrideCalendarRenderer))]
namespace XFExamples.iOS
{
    public class OverrideCalendarRenderer : Telerik.XamarinForms.InputRenderer.iOS.CalendarRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
        {
            base.OnElementChanged(e);
            if (Control.Presenter is TKCalendarMonthPresenter)
            {
                var presenter = (Control.Presenter as TKCalendarMonthPresenter);
                presenter.Style.TitleCellHeight = 100;
            }
        }
    }
}

I hope this helps.

Regards,
Nikolay Demirev
Progress 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
Asked by
Benjamin
Top achievements
Rank 1
Answers by
Emily
Top achievements
Rank 1
Andriy
Top achievements
Rank 1
Nikolay Demirev
Telerik team
Share this question
or