@@ -54,8 +54,6 @@ You can find examples of both below.
54
54
> caption Two-way binding for the selected date
55
55
56
56
```` CSHTML
57
- @* With single selection, you can use two-way binding of the selected date *@
58
-
59
57
<TelerikCalendar @bind-Date="@startDate"
60
58
@bind-Value="@SelectedDate"
61
59
SelectionMode="@CalendarSelectionMode.Single">
@@ -74,24 +72,24 @@ You can find examples of both below.
74
72
> caption Handle Single selection in the Calendar through an event
75
73
76
74
```` CSHTML
77
- @* This example shows how to handle Single selection *@
78
-
79
- <TelerikCalendar @bind-Date="@startDate"
75
+ <TelerikCalendar @bind-Date="@StartDate"
80
76
SelectionMode="@CalendarSelectionMode.Single"
77
+ Value="@SelectedDate"
81
78
ValueChanged="SelectionHandler">
82
79
</TelerikCalendar>
83
80
84
81
<p>
85
- Selected Date: @SelectedDate
82
+ Selected Date: @SelectedDate.ToShortDateString()
86
83
</p>
87
84
88
85
@code {
89
- private DateTime SelectedDate { get; set; }
90
- private DateTime startDate = new DateTime(2019, 5, 2);
86
+ private DateTime SelectedDate { get; set; } = DateTime.Today;
87
+
88
+ private DateTime StartDate = DateTime.Today;
91
89
92
- public void SelectionHandler(DateTime selectedDate )
90
+ private void SelectionHandler(DateTime newDate )
93
91
{
94
- SelectedDate = selectedDate ;
92
+ SelectedDate = newDate ;
95
93
}
96
94
}
97
95
````
@@ -104,8 +102,6 @@ With multiple selection mode, to get the user selection, use the `SelectedDates`
104
102
> caption Handle Multiple selection in the Calendar
105
103
106
104
```` CSHTML
107
- @* This example shows how to handle Multiple selection *@
108
-
109
105
<TelerikCalendar @ref="@CalendarRef"
110
106
SelectionMode="@CalendarSelectionMode.Multiple"
111
107
ValueChanged="@OnCalendarValueChanged">
0 commit comments