|
| 1 | +--- |
| 2 | +title: Changing the Appointment Default Style in UI for .NET MAUI Scheduler |
| 3 | +description: Learn how to change the default style of appointments in the UI for .NET MAUI Scheduler, specifically focusing on modifying the background color without creating a DataTemplate. |
| 4 | +type: how-to |
| 5 | +page_title: Modify Appointment Style in UI for .NET MAUI Scheduler |
| 6 | +meta_title: Modify Appointment Style in UI for .NET MAUI Scheduler |
| 7 | +slug: change-appointment-default-style-ui-net-maui-scheduler |
| 8 | +tags: scheduler, ui for .net maui, appointmentview, backgroundcolor |
| 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 change the default style of appointments in the [UI for .NET MAUI Scheduler](https://www.telerik.com/maui-ui/documentation/controls/scheduler/overview). Specifically, I am looking to modify only the background color of the appointments without creating a custom DataTemplate. |
| 21 | + |
| 22 | +This knowledge base article also answers the following questions: |
| 23 | +- How to change `Appointment` background color in UI for .NET MAUI Scheduler? |
| 24 | +- How to customize `AppointmentView` style in UI for .NET MAUI Scheduler? |
| 25 | +- How to apply an implicit style to Scheduler appointments in UI for .NET MAUI? |
| 26 | + |
| 27 | +## Solution |
| 28 | +To change the background color of the appointments without creating a `DataTemplate`, use an implicit style targeting the `AppointmentView` element. Below is an example: |
| 29 | + |
| 30 | +```xaml |
| 31 | +<ContentPage.Resources> |
| 32 | + <ResourceDictionary> |
| 33 | + <Style TargetType="telerik:AppointmentView"> |
| 34 | + <Setter Property="BackgroundColor" Value="LightBlue" /> |
| 35 | + </Style> |
| 36 | + </ResourceDictionary> |
| 37 | +</ContentPage.Resources> |
| 38 | + |
| 39 | +<telerik:RadScheduler AppointmentsSource="{Binding Appointments}"> |
| 40 | + <telerik:RadScheduler.ViewDefinitions> |
| 41 | + <telerik:MultidayViewDefinition /> |
| 42 | + </telerik:RadScheduler.ViewDefinitions> |
| 43 | +</telerik:RadScheduler> |
| 44 | +``` |
| 45 | + |
| 46 | +## See Also |
| 47 | + |
| 48 | +- [Scheduler Overview in UI for .NET MAUI](https://www.telerik.com/maui-ui/documentation/controls/scheduler/overview) |
| 49 | +- [Appointment Styling](https://www.telerik.com/maui-ui/documentation/controls/scheduler/styling/appointments-styling) |
| 50 | + |
0 commit comments