# .NET MAUI Calendar Events

The Telerik UI for <a href="https://www.telerik.com/maui-ui/calendar" target="_blank">.NET MAUI Calendar</a> component exposes a set of events that users trigger through interaction. You can handle these events and customize the configuration of the UI component.

The Calendar for .NET MAUI exposes the [`DisplayDateChanged`](https://www.telerik.com/maui-ui/documentation/controls/calendar/events#displaydatechanged) and the [`SelectionChanged`](https://www.telerik.com/maui-ui/documentation/controls/calendar/events#selectionchanged) events.

## DisplayDateChanged

The `DisplayDateChanged` event is invoked when the current display date is changed. The `DisplayDateChanged` event handler receives two parameters:

* The sender argument, which is of type `object`, but can be cast to the `RadCalendar` type.
* A `ValueChangedEventArgs<DateTime>` object, which provides both the old and new values of the `DisplayDate` property. The values are of type `DateTime`.

The following example demonstrates how to use the `DisplayDateChanged` event:

**1.** Define the Calendar:

```XAML
<Grid>
    <telerik:RadCalendar x:Name="calendar"
                         DisplayDateChanged="OnDisplayDateChanged" />
</Grid>
```

**2.** And the event handler:

```C#
    private void OnDisplayDateChanged(object sender, ValueChangedEventArgs<System.DateTime> e)
    {
	App.Current.Windows[0].Page.DisplayAlert("Date is ","" + e.NewValue, "OK");
    }
```

## SelectionChanged

The `SelectionChanged` event is invoked when the selection changes. The `SelectionChanged` event handler receives two parameters:

* The `sender`, which is the `RadCalendar` control.
* The `CalendarSelectionChangedEventArgs` object, which provides the following properties:
  * `RemovedDates`—The deselected dates.
  * `AddedDates`—The selected dates.

The following example demonstrates how to use the `SelectionChanged` event:

**1.** Define the Calendar:

```XAML
<Grid>
    <telerik:RadCalendar x:Name="calendar"
                         SelectionChanged="OnSelectionChanged" />
</Grid>
```

**2.** And the event handler:

```C#
private void OnSelectionChanged(object sender, Telerik.Maui.Controls.Calendar.CalendarSelectionChangedEventArgs e)
{
    App.Current.Windows[0].Page.DisplayAlert("You have selected: ", "" + e.AddedDates.FirstOrDefault(), "OK");
}
```

## See Also

* [Navigation Between the Different Views](https://www.telerik.com/maui-ui/documentation/controls/calendar/navigation)
* [Specify the Formatting](https://www.telerik.com/maui-ui/documentation/controls/calendar/formatting)
* [Selection modes](https://www.telerik.com/maui-ui/documentation/controls/calendar/selection)
* [Use the exposed Commands](https://www.telerik.com/maui-ui/documentation/controls/calendar/commands)
* [Define Templates](https://www.telerik.com/maui-ui/documentation/controls/calendar/templates)
* [Calendar Header Styling](https://www.telerik.com/maui-ui/documentation/controls/calendar/styling/header-styling)
