# Selection

## Content



The Calendar control allows users to select a day on the calendar by tapping a date. However, you can set the number of days that you wish to select by using the [MaxSelectionCount](/componentone/api/xamarin/online-forms/dotnet-api/C1.Xamarin.Forms.Calendar/C1.Xamarin.Forms.Calendar.C1Calendar.MaxSelectionCount.html) property in code. For instance, on setting the **MaxSelectionCount** property to 5, you can select a maximum of 5 days on the calendar as illustrated in the image below.

![](https://cdn.mescius.io/document-site-files/images/fb6b46a2-eac0-487c-84c3-5e1b4c7b1348/images/calendar_maxselection.png)

The following code examples illustrate how to set maximum selection in C# and XAML. The following examples uses the samples created in the [Quick Start](/componentone/docs/xamarin/online-forms/controls/CalendarOverview/CalendarQuickStart) section.

### In Code

```csharp
// setting maximum selection
calendar.MaxSelectionCount = 5;
```

### In XAML

```xml
<Grid>
    <c1:C1Calendar x:Name="calendar" MaxSelectionCount="5" />
</Grid>
```