Skip to content

SyncfusionExamples/how-to-display-a-full-week-view-in-winForms-scheduleControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

How to display a full Week View in WinForms ScheduleControl?

In WinForms ScheduleControl, displaying the full week view including weekend is supported by using the CustomWeek value for the ScheduleType property and specifying the selected dates to include all seven days of the week along with the start day .

this.scheduleControl1.ScheduleType = ScheduleViewType.CustomWeek;

this.scheduleControl1.Calendar.SelectedDates.BeginUpdate();
this.scheduleControl1.Calendar.SelectedDates.Clear();
for (int i = 0; i < 7; i++)
{
   // Add 7 days and start day.
   this.scheduleControl1.Calendar.SelectedDates.Add(DateTime.Now.StartOfWeek(DayOfWeek.Sunday).AddDays(i));
}
this.scheduleControl1.Calendar.SelectedDates.EndUpdate();
public static class Extensions
{
    public static DateTime StartOfWeek(this DateTime dt, DayOfWeek startOfWeek)
    {
        int diff = (7 + (dt.DayOfWeek - startOfWeek)) % 7;
        return dt.AddDays(-1 * diff).Date;
    }
}

CustomWeek

Take a moment to peruse the WinForms ScheduleControl - Changing Views documentation, where you can find about schedule view types.

About

How to display a full Week View in WinForms ScheduleControl?

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages