We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize AgendaView height based on schedule height?

Platform: Xamarin.Forms |
Control: SfSchedule |
Published Date: January 9, 2020 |
Last Revised Date: January 9, 2020

AgendaView height customization based on SfSchedule height

The SfSchedule allows you to customize AgendaView height in runtime. This article explains how to customize the AgendaView height based on schedule height and device orientation in runtime.

 

Step 1: Initialize an event handler for the SizeChanged event of SfSchedule.

 
schedule.SizeChanged += OnScheduleSizeChanged;

 

Step 2: In the SizeChanged event handler, get SfSchedule height and based on SfSchedule height and orientation, calculate height for AgendaView and assign it to the AgendaViewHeight property of SfSchedule MonthViewSettings.

 

private void OnScheduleSizeChanged(object sender, EventArgs e)
{
        var scheduler = sender as SfSchedule;
        if(scheduler.Width > scheduler.Height && Device.RuntimePlatform != Device.UWP)
        {
                schedule.MonthViewSettings.AgendaViewHeight = schedule.Height * 0.3;
         }
         else
         {
                schedule.MonthViewSettings.AgendaViewHeight = schedule.Height * 0.5;
         }
}

 

Sample Demo: AgendaHeightCustomization

 

Agenda view height customization

 

 

 

 

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile