Skip to content

Commit 702ccb4

Browse files
author
KB Bot
committed
Added new kb article scheduler-month-view-clickable-three-dots
1 parent 119c291 commit 702ccb4

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
title: Making the Three Dots in Scheduler Month View Clickable
3+
description: Learn how to make the three dots clickable in the Scheduler Month View for small resolutions, allowing users to view and select events.
4+
type: how-to
5+
page_title: Enabling Clickable Three Dots in Scheduler Month View for Event Selection
6+
meta_title: Clickable Three Dots in UI for .NET MAUI Scheduler Month View
7+
slug: scheduler-month-view-clickable-three-dots
8+
tags: scheduler, ui-for-dotnet-maui, events, monthdaytapped, commands, appointments
9+
res_type: kb
10+
---
11+
12+
## Environment
13+
14+
| Version | Product | Author |
15+
| --- | --- | ---- |
16+
| 11.1.0 | Telerik UI for .NET MAUI Scheduler | [Dobrinka Yordanova](https://www.telerik.com/blogs/author/dobrinka-yordanova) |
17+
18+
## Description
19+
20+
I want to make the three dots in the Scheduler Month View clickable, especially for small resolutions. Users should be able to interact with these dots to view and select events for a specific day. The goal is to either switch to the Day View of the selected date or display a pop-up/dialog listing the events for that day.
21+
22+
This knowledge base article also answers the following questions:
23+
- How to handle the `MonthDayTapped` event in Scheduler?
24+
- How to retrieve appointments for a specific day in the Scheduler Month View?
25+
- How to display a list of events when the three dots are clicked?
26+
27+
## Solution
28+
29+
To make the three dots clickable and retrieve all appointments for a specific day, use the `MonthDayTapped` event or `MonthDayTapCommand`. Below is an example of using the `MonthDayTapped` event:
30+
31+
1. Define the Scheduler and bind the `MonthDayTapped` event.
32+
33+
```xaml
34+
<telerik:RadScheduler x:Name="scheduler"
35+
MonthDayTapped="scheduler_MonthDayTapped"
36+
AppointmentsSource="{Binding Appointments}">
37+
<telerik:RadScheduler.ViewDefinitions>
38+
<telerik:MonthViewDefinition />
39+
</telerik:RadScheduler.ViewDefinitions>
40+
</telerik:RadScheduler>
41+
```
42+
43+
2. Create a `ViewModel` with a list of appointments. This will serve as the data source.
44+
45+
```csharp
46+
public class ViewModel
47+
{
48+
public ViewModel()
49+
{
50+
var date = DateTime.Today;
51+
this.Appointments = new ObservableCollection<Appointment>
52+
{
53+
new Appointment {
54+
Subject = "Meeting",
55+
Start = date.AddHours(10),
56+
End = date.AddHours(11)
57+
},
58+
new Appointment {
59+
Subject = "Lunch",
60+
Start = date.AddHours(12).AddMinutes(30),
61+
End = date.AddHours(14)
62+
},
63+
new Appointment {
64+
Subject = "Elle Birthday",
65+
Start = date,
66+
End = date.AddHours(11),
67+
IsAllDay = true
68+
}
69+
};
70+
}
71+
72+
public ObservableCollection<Appointment> Appointments { get; set; }
73+
}
74+
```
75+
76+
3. Handle the `MonthDayTapped` event to retrieve appointments for the selected day and display them in a dialog.
77+
78+
```csharp
79+
public partial class MainPage : ContentPage
80+
{
81+
ViewModel vm;
82+
83+
public MainPage()
84+
{
85+
InitializeComponent();
86+
this.vm = new ViewModel();
87+
this.BindingContext = this.vm;
88+
}
89+
90+
private void scheduler_MonthDayTapped(object sender, TappedEventArgs<DateTime> e)
91+
{
92+
var items = this.vm.Appointments;
93+
var appointmentsFromDay = new List<Appointment>();
94+
foreach (var item in items)
95+
{
96+
if (item.Start.Day == e.Data.Day)
97+
{
98+
appointmentsFromDay.Add(item);
99+
}
100+
}
101+
App.Current.MainPage.DisplayAlert("", appointmentsFromDay.Count + " Appointments", "OK");
102+
}
103+
}
104+
```
105+
106+
Modify the logic further based on your specific requirements.
107+
108+
## See Also
109+
110+
- [Scheduler Events](https://www.telerik.com/maui-ui/documentation/controls/scheduler/events)
111+
- [Scheduler Commands](https://www.telerik.com/maui-ui/documentation/controls/scheduler/commands)
112+
- [UI for .NET MAUI Scheduler Overview](https://www.telerik.com/maui-ui/documentation/controls/scheduler/overview)

0 commit comments

Comments
 (0)