How to select all days in week when week number is clicked in MonthCalendarAdv control

To select all week days when week number in MonthCalendarAdv is clicked handle ItemClick event and use following code:

C#

privatevoid monthCalendarAdv1_ItemClick(object sender, EventArgs e){
DayLabel label = sender as DayLabel;// If day label is clicked and label is used to display week of yearif(label !=null&& label.IsWeekOfYear){// Ensure that multi-selection is enabled
monthCalendarAdv1.MultiSelect=true;// Get the month control that represents the month that label is assigned to// so complete date can be retrieved
SingleMonthCalendar month = label.Parentas SingleMonthCalendar;// Parse the week of year from textint week =int.Parse(label.Text);// Get the month where week of year clicked resides
DateTime d = month.DisplayMonth;// Forward date to the beginning of the weekwhile(CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(d, month.WeekOfYearRule, month.FirstDayOfWeek)!= week)
d = d.AddDays(1);// Finally select the week...
monthCalendarAdv1.SelectionStart= d;
monthCalendarAdv1.SelectionEnd= d.AddDays(6);}}

VB

PrivateSub monthCalendarAdv1_ItemClick(sender AsObject, e As EventArgs)
Dim label As DayLabel = TryCast(sender, DayLabel)
' If day label is clicked and label is used to display week of year
If label IsNot Nothing AndAlso label.IsWeekOfYear Then' Ensure that multi-selection is enabled
monthCalendarAdv1.MultiSelect = True' Get the month control that represents the month that label is assigned to
' so complete date can be retrieved
Dim month As SingleMonthCalendar = TryCast(label.Parent, SingleMonthCalendar)
' Parse the week of year from text
Dim week AsInteger = Integer.Parse(label.Text)
' Get the month where week of year clicked resides
Dim d As DateTime = month.DisplayMonth
' Forward date to the beginning of the week
While CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(d, month.WeekOfYearRule, month.FirstDayOfWeek) <> week
d = d.AddDays(1)
EndWhile' Finally select the week...
monthCalendarAdv1.SelectionStart = d
monthCalendarAdv1.SelectionEnd = d.AddDays(6)
EndIfEndSub