New to Telerik UI for Blazor? Download Free 30-day trial
Calendar - Selection
- EDIT IN TELERIK REPL
- Change Theme
Select a date by clicking on it - you can choose only one.
Select several dates by holding down the
keys when clicking on it.
When you select the first date, it is marked as the start of the range and the Calendar will highlight the range you would choose with the second click.
Telerik UI for Blazor Calendar allows you to select dates and exposes an option to configure the selection mode. The selection mode of the Calendar controls how many dates the user will be able to select. To specify the desired mode, use the
SelectionMode property. It takes a member of the
Telerik.Blazor.CalendarSelectionMode enum. The available options are:
- Single Selection Mode (the default)
- Multiple Selection Mode
- Range Selection Mode
Single Selection Mode is enabled, the user will be able to select only one date. This option is useful if you want to restrict the user selection to a single value and the desired output of the Blazor Calendar is just one
Multiple Selection Mode allows the user to select multiple random dates. In this case, you can use the
SelectedDates property of the Blazor Calendar to get or set the selected dates collection. It accepts a
DateTime objects and supports two-way binding.
Range Selection Mode is enabled, the user can select a range of dates. In this case, the
RangeStart property of the Blazor Calendar gets and sets the first date of the selection and the
RangeEnd property gets and sets the last date of the selection. Both parameters support two-way binding.
The current demo showcases three Blazor Calendar instances, one for each of the available selection modes. Make a selection in the different modes to explore the Calendar behavior. With
Multiple Selection enabled, the dates can be selected by holding down the
Ctrl keys when clicking them. With
Range Selection enabled, clicking on a date will mark it as a range start. Clicking on another date after the start will mark it as a range end.