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

How to display all days in TimelineMonth-View

Hi,


how can I display all days in TimelineMonth view?

If I set the TimeIntervalSize to -1 only on day is displayed:


If I set it to a fixed value (eg. 40) then there is a white space on the right if the window is greater than all visible days:

 


1 Reply 1 reply marked as answer

SS SaiGanesh Sakthivel Syncfusion Team January 23, 2023 01:46 PM UTC

Hi Perter,


Your requirement can be achieved with the help of SizeChanged event in the SfScheduler. Inside the event, calculate the TimeIntervalSize by dividing the scheduler width with total days in the month. Please refer to the code snippet for your reference.


Code Snippet

public MainWindow()

{

    InitializeComponent();

    schedule.TimelineViewSettings.TimeIntervalSize = (double)(this.Width / DateTime.DaysInMonth(this.schedule.DisplayDate.Year, this.schedule.DisplayDate.Month));

}

 

private void schedule_SizeChanged(object sender, SizeChangedEventArgs e)

{

    schedule.TimelineViewSettings.TimeIntervalSize = (e.NewSize.Width / DateTime.DaysInMonth(this.schedule.DisplayDate.Year, this.schedule.DisplayDate.Month));

}


Please refer to the demo sample in the following locations.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SchedulerWPF759709168


Please let us know if you have any concerns.


Regards,
SaiGanesh Sakthivel


Marked as answer
Loader.
Up arrow icon