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
close icon

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

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

5 Replies

JP Jagadeesan Pichaimuthu Syncfusion Team 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 



SM Smokeball 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


SP Subburaj Pandian Veluchamy Syncfusion Team 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  



SM Smokeball 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?


SP Subburaj Pandian Veluchamy Syncfusion Team 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  


Loader.
Live Chat Icon For mobile
Up arrow icon