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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Additional Controls

Thread ID:

Created:

Updated:

Platform:

Replies:

142959 Feb 27,2019 02:02 AM UTC Feb 27,2019 12:42 PM UTC Xamarin.Forms 1
loading
Tags: SfCalendar
Frank
Asked On February 27, 2019 02:03 AM UTC

I have copied your example calendar installation to my solution. 

I am interested in adding some label and button controls to the "MainPage" either on top of or below the SfCalendar. 
------------------------------------------------------------------------------------------------------------------------------------
XAML

       
           
               
                        CurrentMonthBackgroundColor="#ffffff"
                        CurrentMonthTextColor="#000000"
                        PreviousMonthBackgroundColor="#f2f2f2"
                        PreviousMonthTextColor="#000000"
                        DateSelectionColor="Aqua"
                        SelectedDayTextColor="#000000"
                        BorderColor="Aqua"
                        DayHeaderBackgroundColor="#000000"
                        DayHeaderTextColor="Aqua" 
                        CellGridOptions="Both"
                        TodayTextColor="Aqua" 
                        DayLabelTextAlignment="Center"
                        DateTextAlignment="Center" >
                   
                       
                            DateFormat="dd"
                            DayFormat="EEE"
                            DayLabelSize="22"
                            DateLabelSize="14" />
                   
                   
           
       
   
---------------------------------------------------------------------------------------------------------------------------------------
C#

public MainPage()
{
            InitializeComponent();

            SfCalendar calendar = new SfCalendar();

            MonthLabelSettings labelSettings = new MonthLabelSettings();
            labelSettings.DateFormat = "dd";
            labelSettings.DayLabelSize = 20;
            labelSettings.DayFormat = "EEE";
            labelSettings.DateLabelSize = 12;

            MonthViewSettings monthViewSettings = new MonthViewSettings();
            monthViewSettings.CurrentMonthBackgroundColor = Color.FromHex("#ffffff");
            monthViewSettings.CurrentMonthTextColor = Color.FromHex("#000000");
            monthViewSettings.PreviousMonthBackgroundColor = Color.FromHex("#f2f2f2");
            monthViewSettings.PreviousMonthTextColor = Color.FromHex("#000000");
            monthViewSettings.DateSelectionColor = Color.Aqua;
            monthViewSettings.SelectedDayTextColor = Color.FromHex("#000000");
            monthViewSettings.BorderColor = Color.Aqua;
            monthViewSettings.DayHeaderBackgroundColor = Color.FromHex("#000000");
            monthViewSettings.DayHeaderTextColor = Color.Aqua;
            monthViewSettings.CellGridOptions = CellGridOptions.Both;
            monthViewSettings.DayLabelTextAlignment = DayLabelTextAlignment.Center;
            monthViewSettings.DateTextAlignment = DateTextAlignment.Center;
            monthViewSettings.TodayTextColor = Color.Aqua;
            
            monthViewSettings.MonthLabelSettings = labelSettings;
            calendar.MonthViewSettings = monthViewSettings;

            this.Content = calendar;
}
--------------------------------------------------------------------------------------------------------------------------------------

When I attempt to throw in a Button control or Label control it either doesn't show up or it says "The Property 'Content' is set more than once."

I am new to this. Any advice? Also where would I put the controls in XAML and C#? Thanks in advance. Appreciate any help I can get.

Subburaj Pandian Veluchamy [Syncfusion]
Replied On February 27, 2019 12:42 PM UTC

Hi Frank, 
 
Thank you for contacting Syncfusion support. 
 
Based on the provided information, we have checked your query about “How to add button or other control along with calendar” and you can achieve this by placing calendar and button an any of the layout on the default content page. We suspect that you have set both the elements in the same, so that issue may occurs. Hence you need to place a layout and arrange the required controls inside the layout based on your requirement. 
 
We have prepared sample for the same, please find the sample by the following link. 
 
Sample link: Calendar. 
 
We hope that this helps you. If this sample doesn’t meet your requirement, kindly revert with more details, which helps us to analyze and resolve your requirement. 
 
Regards,
Subburaj Pandian V  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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
Live Chat Icon