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

Configure MonthView to show only 2 weeks, and also configure to not show previous and next month dates.

Thread ID:

Created:

Updated:

Platform:

Replies:

142013 Jan 15,2019 03:33 AM UTC Jan 23,2019 09:24 AM UTC Xamarin.Forms 5
loading
Tags: SfSchedule
Smokeball
Asked On January 15, 2019 03:33 AM UTC

I have two questions:

Is it possible to configure when in MonthView, to show only 2 weeks, i.e. sort of like a compact mode.

The other question is, is it possible to configure to now show the previous and next month, right now it shwos a few days from the previous and next month but grayed out.

Thanks

Jagadeesan Pichaimuthu [Syncfusion]
Replied On January 16, 2019 09:02 AM UTC

Hi Winston,  
  
Thanks for using Syncfusion product. 
  
We have checked you query with “show only 2 weeks and show the previous and next month” and as of now we don’t have any support to display only 2 weeks or showing the previous and next month in SfSchedule control.  
  
Regards, 
Jagadeesan 


Smokeball
Replied On January 16, 2019 09:29 PM UTC

Hi,

Is there anyway to hack getting the Previous and Next month's dates to not show up, i.e. if I am in the month of January, I don't want to see any of December and February's days, I know that they are grayed out, but I want them to not show up at all.

My only avenue to support this is 

        private void Schedule_OnOnMonthCellLoadedEvent(object sender, MonthCellLoadedEventArgs e)
        {
            if (e.isNextMonthDate || e.isPreviousMonthDate)
                e.view = new Grid();
        }

But it doesn't stop it from being "selectable". How could we stop that?

Thanks

Subburaj Pandian Veluchamy [Syncfusion]
Replied On January 17, 2019 12:44 PM UTC

Hi Winston, 
  
Thanks for the update. 
  
We have analyzed your query “Want to hide the previous and next month dates in month view” based on the code you have shared, we have found a solution that instead of using Grid you can use button as a custom view for Previous and Next months, which can prevent selection. 
  
[c#] 
private void Schedule_OnMonthCellLoadedEvent(object sender, MonthCellLoadedEventArgs e) 
        { 
            if (e.isNextMonthDate || e.isPreviousMonthDate) 
            { 
                Button button = new Button(); 
                button.BackgroundColor = Color.Transparent; 
                e.view = button; 
            } 
        } 
  
Sample: Schedule. 
  
We hope that this helps you, kindly revert us if you have any concern. 
  
Regards,
Subburaj Pandian V  


Smokeball
Replied On January 22, 2019 11:03 AM UTC

Thanks for the reply. Even though this works and it does hide the previous months dates and disables selection, it just ends up with a white space now, so a whole row (week) of white space, anyways to work around this?

Subburaj Pandian Veluchamy [Syncfusion]
Replied On January 23, 2019 09:24 AM UTC

Hi Winston,  
   
Thank you for the update.  
 
We have checked your requirement of Showing only current month dates in Schedule Xamarin.Forms, as we shared you can able to achieve by setting empty custom views to the previous and next month dates using OnMonthCellLoadedEvent of Schedule. As per the implementation, empty rows can’t be hide in the month view and it can’t be achievable. Since, month dates rendered based on the week days (Sunday, Monday,..) and handled six rows to render dates based on the week number it has started. So, that removing empty rows in the month is not feasible.  
 
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