Exploring the Range Selection Modes in .NET MAUI Calendar
Tags: netmaui, mobile, ui
Published: 2023-03-22 01:56:44

---
title: Exploring the Range Selection Modes in .NET MAUI Calendar
published: true
date: 2023-03-21 11:29:26 UTC
tags: netmaui, mobile, ui
canonical_url: https://www.syncfusion.com/blogs/post/range-selection-in-dotnet-maui-calendar.aspx
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgv57uujpdv9oi5aznth.png
---
The [Syncfusion .NET MAUI Calendar](https://www.syncfusion.com/maui-controls/maui-calendar "Syncfusion .NET MAUI Calendar") supports selecting a range of dates rather than just a single date. This can be useful for scheduling events or tasks that span multiple days or tracking your progress on a project over time. In this blog post, we’ll explore the different [range selection](https://help.syncfusion.com/maui/calendar/selections#range-selection "Range selection modes in .NET MAUI Calendar") options available in the calendar.

**Note:** If you are new to our .NET MAUI Calendar control, you can check out its [getting started](https://help.syncfusion.com/maui/calendar/getting-started "Getting started with .NET MAUI Calendar (SfCalendar)") and [single](https://help.syncfusion.com/maui/calendar/selections#single-selection "Single selection mode in .NET MAUI Calendar") and [multiple](https://help.syncfusion.com/maui/calendar/selections#multiple-selection "Multiple selection mode in .NET MAUI Calendar") selection documentation before proceeding with these various range selections in calendar applications.

## Different range selection options

There are several ways to extend selected ranges to fit the specific needs of different users and use cases.

### Default range selection

The default range selection option is to select a single range of dates. This is typically done by selecting a start date and an end date.

Refer to the following code example.

**XAML:**

```xml
<calendar:SfCalendar x:Name="Calendar" 
                   View="Month"
                   SelectionMode="Range"/>
```

**C#:**

```csharp
this.Calendar.SelectionMode = CalendarSelectionMode.Range;
```

![Default Range Selection Mode in .NET MAUI Calendar](https://www.syncfusion.com/blogs/wp-content/uploads/2023/03/Default-Range-Selection-Mode-in-.NET-MAUI-Calendar.gif)

### Extending start of range selection in Calendar

This mode allows users to extend the start of the selected range but not the end. This is useful, for example, when the user needs to start a project earlier than expected. Refer to the following code example.

**XAML:**

```xml
<calendar:SfCalendar x:Name="Calendar" 
                      View="Month"
                      SelectionMode="Range"
                      RangeSelectionDirection="Backward"/>
```

**C#:**

```csharp
this.Calendar.SelectionMode = CalendarSelectionMode.Range;
this.Calendar.RangeSelectionDirection = CalendarRangeSelectionDirection.Backward;
```

![Backward Range Selection Mode in .NET MAUI Calendar](https://www.syncfusion.com/blogs/wp-content/uploads/2023/03/Backward-Range-Selection-Mode-in-.NET-MAUI-Calendar.gif)

### Extending end of range selection in Calendar

This mode allows users to extend the end of the range they have selected but not the start. This is useful for situations where the user needs to choose vacation dates. Refer to the following code example.

**XAML:**

```xml
<calendar:SfCalendar x:Name="Calendar" 
                      View="Month"
                      SelectionMode="Range"
                      RangeSelectionDirection="Forward"/>
```

**C#:**

```csharp
this.Calendar.SelectionMode = CalendarSelectionMode.Range;
this.Calendar.RangeSelectionDirection = CalendarRangeSelectionDirection.Forward;

```

![Forward Range Selection Mode in .NET MAUI Calendar](https://www.syncfusion.com/blogs/wp-content/uploads/2023/03/Forward-Range-Selection-Mode-in-.NET-MAUI-Calendar.gif)

### Extendable start and end of ranges in Calendar

This mode allows users to extend the start and end of the range they have selected by dragging the edges of the range. This is useful when the user needs to adjust the range slightly, such as when scheduling a meeting or event. Refer to the following code example.

**XAML:**

```xml
<calendar:SfCalendar x:Name="Calendar" 
                      View="Month"
                      SelectionMode="Range"
                      RangeSelectionDirection="Both"/>
```

**C#:**

```csharp
this.Calendar.SelectionMode = CalendarSelectionMode.Range;
this.Calendar.RangeSelectionDirection = CalendarRangeSelectionDirection.Both;

```

![Forward and Backward Range Selection Modes in .NET MAUI Calendar](https://www.syncfusion.com/blogs/wp-content/uploads/2023/03/Forward-and-Backward-Range-Selection-Modes-in-.NET-MAUI-Calendar.gif)

### Non-extendable range in Calendar

This mode allows you to prevent ranges from being selected and does not allow users to modify the selected range. This is useful when you need to limit the range modification, such as when unauthorized users see a scheduled meeting or event. Refer to the following code example.

**XAML:**

```xml
<calendar:SfCalendar x:Name="Calendar" 
                      View="Month"
                      SelectionMode="Range"
                      RangeSelectionDirection="None"/>
```

**C#:**

```csharp
this.Calendar.SelectionMode = CalendarSelectionMode.Range;
this.Calendar.RangeSelectionDirection = CalendarRangeSelectionDirection.None;
```

![Non-Extendable Range Selection Mode in .NET MAUI Calendar](https://www.syncfusion.com/blogs/wp-content/uploads/2023/03/Non-Extendable-Range-Selection-Mode-in-.NET-MAUI-Calendar.gif)

It’s important to consider the context of the application and the users’ needs when deciding which extendable range mode to use. For example, a scheduling app for a hair salon would be better served by the extendable start and end of range mode, as customers can adjust the start and end times of their appointment as needed. On the other hand, a project management tool would be better served by non-extendable range, as it does not allow team members to extend the range of a task.

## Conclusion

In summary, different range modes in the [.NET MAUI Calendar](https://www.syncfusion.com/maui-controls/maui-calendar "Syncfusion .NET MAUI Calendar") offer various ways for users to extend their selected range. The appropriate method should be chosen based on the context of the application and the users’ needs. This allows for a more versatile and user-friendly calendar.

Try out our .NET MAUI control [demos on GitHub](https://github.com/syncfusion/maui-demos "Syncfusion .NET MAUI controls GitHub demos") and share your feedback or ask questions in the comments section below.

If you are not a Syncfusion customer, you can try our 30-day [free trial](https://www.syncfusion.com/downloads "Free evaluation of Essential Studio products") to see how our components can enhance your projects.

If you have questions, you can reach us through our [support forum](https://www.syncfusion.com/forums "Syncfusion Support Forum"), [support portal](https://support.syncfusion.com/ "Syncfusion Support Portal"), or [feedback portal](https://www.syncfusion.com/feedback/home "Syncfusion Feedback Portal"). We are always happy to assist you!

## Related blogs

- [Exploring the Features of the .NET MAUI Calendar Control](https://www.syncfusion.com/blogs/post/dotnet-maui-calendar.aspx "Blog: Exploring the Features of the .NET MAUI Calendar Control")
- [Exploring the New Features and Improvements in .NET 7](https://www.syncfusion.com/blogs/post/exploring-the-new-features-and-improvements-in-net-7.aspx "Blog Exploring the New Features and Improvements in .NET 7")
- [Exploring Column Types in Syncfusion .NET MAUI DataGrid](https://www.syncfusion.com/blogs/post/exploring-column-types-in-syncfusion-net-maui-datagrid.aspx "Blog: Exploring Column Types in Syncfusion .NET MAUI DataGrid")
- [Create and Validate a Sign-Up Form in .NET MAUI](https://www.syncfusion.com/blogs/post/create-validate-sign-up-form-in-dotnet-maui.aspx "Blog: Create and Validate a Sign-Up Form in .NET MAUI")