In order to display the week end in WorkWeek view, you can use the CustomWeek schedule view and SelectedDates property can be used to add the dates in ScheduleControl. Please refer to the below code example and the sample,
Code example
this.scheduleControl1.GetScheduleHost().Calendar.SelectedDates.Clear();
this.GetWeekDays();
private void GetWeekDays()
{
int count = 7;//No of days in week.
this.scheduleControl1.GetScheduleHost().Calendar.SelectedDates.BeginUpdate();
DateTime theDate = this.scheduleControl1.GetScheduleHost().Calendar.DateValue;
while (theDate.DayOfWeek != this.scheduleControl1.Appearance.NavigationCalendarStartDayOfWeek)
{
theDate = theDate.AddDays(-1);
}
this.scheduleControl1.GetScheduleHost().Calendar.SelectedDates.Clear();
while (count > 0)
{
this.scheduleControl1.GetScheduleHost().Calendar.SelectedDates.Add(theDate);
theDate = theDate.AddDays(1);
count--;
}
this.scheduleControl1.GetScheduleHost().Calendar.SelectedDates.EndUpdate();
}
Note
If you want to navigate the weeks using caption panel arrow. Please use the below code,
Code example
foreach (Control con in this.scheduleControl1.CaptionPanel.Controls)
{
if (con is ThemedScrollButton)
{
ThemedScrollButton button = con as ThemedScrollButton;
button.Click += button_Click;
}
}
void button_Click(object sender, EventArgs e)
{
ThemedScrollButton button = sender as ThemedScrollButton;
if (button.Text == "<")//Move to previous week
{
this.MoveInDirection(false);
}
else if (button.Text == ">") //Move to week forward
{
this.MoveInDirection(true);
}
}
|