Create a Roster Scheduler View in Less Than 20 Minutes in Xamarin.Forms
Tags: android, ios, mobile, xamarin
Published: 2020-05-29 06:30:43

---
title: Create a Roster Scheduler View in Less Than 20 Minutes in Xamarin.Forms
published: true
date: 2020-05-26 10:30:20 UTC
tags: android, ios, mobile, xamarin
canonical_url: https://www.syncfusion.com/blogs/post/create-a-roster-scheduler-view-in-less-than-20-minutes-in-xamarin-forms.aspx
cover_image: https://www.syncfusion.com/blogs/wp-content/uploads/2020/05/698-x-400-672x372.jpg
---

**“If you fail to plan, you are planning to fail.”**

**–(reportedly by) Benjamin Franklin**

To plan for a project, you need to know the availability of the employees required to implement it. The [Syncfusion Scheduler control](https://www.syncfusion.com/xamarin-ui-controls/xamarin-scheduler) has all the functionalities you need, helping you develop a Xamarin application to create a roster schedule view.

In this blog, we are going to learn how to create a roster scheduler view using Xamarin.Forms Scheduler (SfSchedule) in a nutshell. It will allow you to track the availability of employees in any given time period. The following screenshot will be output of the application we are going to develop.

![Roster scheduler View](https://www.syncfusion.com/blogs/wp-content/uploads/2020/05/Roster-scheduler-View.png)<figcaption>Roster scheduler View</figcaption>

## Creating a roster scheduler

**Step 1:** Following the getting started [UG documentation](https://help.syncfusion.com/xamarin/scheduler/getting-started), create a Xamarin application and then a SfSchedule control in it.

**Step 2:** Make the following property changes in the add instance of SfSchedule:

1. Set **ScheduleView** property as **TimelineView**.
2. Enable resource view by setting the [ShowResourceView](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfSchedule.XForms~Syncfusion.SfSchedule.XForms.SfSchedule~ShowResourceView.html)property to **True**.
3. Set [ResourceViewMode ](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfSchedule.XForms~Syncfusion.SfSchedule.XForms.SfSchedule~ResourceViewMode.html)to **Absolute**.
4. Set schedule [TimeInterval ](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfSchedule.XForms~Syncfusion.SfSchedule.XForms.SfSchedule~TimeInterval.html)to 1440 (total minutes in a day) to make one slot for a day in **TimelineView**.

```html
<syncfusion:SfSchedule x:Name="schedule"
                           ScheduleView="TimelineView"
                           ShowResourceView="True"
                           ResourceViewMode="Absolute"
                           TimeInterval="1440">
```

**Step 3:** Customize the appearance of the appointment using [AppointmentTemplate](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfSchedule.XForms~Syncfusion.SfSchedule.XForms.SfSchedule~AppointmentTemplate.html), as explained in the following code example.

```html
<syncfusion:SfSchedule.AppointmentTemplate>
        <DataTemplate>
               <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.5*"/>
                            <RowDefinition Height="0.5*"/>
                        </Grid.RowDefinitions>
                        <Label TextColor="Black" FontAttributes="Bold" Text="{Binding Subject}" Grid.Row="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
                        <BoxView Color="{Binding Color}" CornerRadius="5" HeightRequest="10" WidthRequest="10" Grid.Row="1" HorizontalOptions="Center" VerticalOptions="Center" />
             </Grid>
       </DataTemplate>
</syncfusion:SfSchedule.AppointmentTemplate>
```

**Step 4:** In [TimelineViewSettings](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfSchedule.XForms~Syncfusion.SfSchedule.XForms.TimelineViewSettings.html), set [TimeRulerSize](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfSchedule.XForms~Syncfusion.SfSchedule.XForms.TimelineViewSettings~TimeRulerSize.html) to 0 to hide the time ruler, and [DaysCount](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfSchedule.XForms~Syncfusion.SfSchedule.XForms.TimelineViewSettings~DaysCount.html) to 7 to show the timeline for a week.

```csharp
TimelineViewSettings timelineViewSettings = new TimelineViewSettings();
timelineViewSettings.TimeRulerSize = 0;
timelineViewSettings.DaysCount = 7;
this.schedule.TimelineViewSettings = timelineViewSettings;
```

**Note:** Default timeline view starts from the current date. If you want to start the timeline from a particular day, you can set the [MoveToDate](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfSchedule.XForms~Syncfusion.SfSchedule.XForms.SfSchedule~MoveToDate.html) property of a schedule with your desired one.

**Step 5:** Customize the ViewHeader date format as required using the [DateFormat](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfSchedule.XForms~Syncfusion.SfSchedule.XForms.TimelineLabelSettings~DateFormat.html) property in [TimelineLabelSettings](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfSchedule.XForms~Syncfusion.SfSchedule.XForms.TimelineLabelSettings.html).

```csharp
TimelineLabelSettings labelSettings = new TimelineLabelSettings();
labelSettings.DateFormat = Device.RuntimePlatform == "UWP" ? "%d ddd" : "dd EEE";
timelineViewSettings.LabelSettings = labelSettings;
this.schedule.TimelineViewSettings = timelineViewSettings;
```

**Output  
 ![Output](https://www.syncfusion.com/blogs/wp-content/uploads/2020/05/Output-1.png)**

The sample can be downloaded from this [GitHub location](https://github.com/SyncfusionExamples/rosterview-sfschedule-xamarin-forms).

## Conclusion

I hope you now have a clear idea of how to create a roster schedule view using Syncfusion’s [Scheduler](https://www.syncfusion.com/xamarin-ui-controls/xamarin-scheduler) control. The features in this control will reduce your workforce and save time.

If you are an existing Syncfusion user, please download the latest version from the [License and Downloads](https://www.syncfusion.com/account/downloads) page and try the new features for yourself. Also, our NuGet packages are available on [NuGet.org](https://www.nuget.org/).

If you aren’t a customer yet, you can try our 30-day [free trial](https://www.syncfusion.com/downloads) to check out these features. Also, try our other samples from this [GitHub](https://github.com/syncfusion/xamarin-demos/tree/master/Forms/PdfViewer) location.

Feel free to share your feedback or questions in the comments section below. You can also contact us through our [support forum](https://www.syncfusion.com/forums), [Direct-Trac](https://www.syncfusion.com/support/directtrac/), or [feedback portal](https://www.syncfusion.com/feedback/). We are always happy to assist you.

The post [Create a Roster Scheduler View in Less Than 20 Minutes in Xamarin.Forms](https://www.syncfusion.com/blogs/post/create-a-roster-scheduler-view-in-less-than-20-minutes-in-xamarin-forms.aspx) appeared first on [Syncfusion Blogs](https://www.syncfusion.com/blogs).