Articles in this section
Category / Section

How to clear appointments in the AgendaView on month change in Xamarin.Forms Calendar (SfCalendar)

1 min read

You can programmatically clear the selected dates and appointments in AgendaView using the ClearSelection method in Xamarin.Forms SfCalendar.

STEP 1: Set InlineViewMode as Agenda, and set ShowInlineEvents to true for displaying events.

<calendar:SfCalendar x:Name="calendar"
                             ShowInlineEvents="True"
                             InlineViewMode="Agenda"
                             DataSource="{Binding Appointments}">
        <calendar:SfCalendar.BindingContext>
            <local:ViewModel/>
        </calendar:SfCalendar.BindingContext>
</calendar:SfCalendar>

STEP 2: By using the MonthChanged event in the calendar, you can call the ClearSelection method to clear selected date and its appointments in the AgendaView.

private void Calendar_MonthChanged(object sender, MonthChangedEventArgs e)
{
            this.calendar.ClearSelection();
}

Output

Clear Selection

View sample in GitHub

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied