Xamarin.Forms | ComponentOne
Controls / Calendar / Features / Selection
In This Topic
    Selection
    In This Topic

    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 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.

    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 section.

    In Code

    C#
    Copy Code
    // setting maximum selection
    calendar.MaxSelectionCount = 5;
    

    In XAML

    XAML
    Copy Code
    <Grid>
        <c1:C1Calendar x:Name="calendar" MaxSelectionCount="5" />
    </Grid>