# Agenda View

**AgendaViewDefinition** allows you to display a set of appointments for a specific period of time.

> tip See the [Configuration](https://www.telerik.com/products/wpf/documentation/controls/radscheduleview/features/viewdefinitions/configuration) article to see the functionality that is shared accross the different views.

## Setting up the View

To set any of the RadScheduleView's view definition objects, add it in the ViewDefinitions collection. The following example shows how to setup RadScheduleView in a basic scenario and use the AgendaViewDefinition element.

**Example 1: Define RadScheduleView and set AgendaViewDefinition in the ViewDefinitions collection**

```XAML
<telerik:RadScheduleView x:Name="radScheduleView">
    <telerik:RadScheduleView.ViewDefinitions>
        <telerik:AgendaViewDefinition />
    </telerik:RadScheduleView.ViewDefinitions>
</telerik:RadScheduleView>
```

**Example 2: Setting the AppointmentSource of RadScheduleView**

```C#
var currentDate = DateTime.Today;
var source = new ObservableCollection<Appointment>();
for (int i = 0; i < 5; i++)
{
    currentDate = DateTime.Today.AddDays(i);
    for (int k = 0; k < 3; k++)
    {
        source.Add(new Appointment() { Subject = "Appointment " + k, Start = currentDate.AddHours(k), End = currentDate.AddHours(k + 1) });
    }
}

this.radScheduleView.AppointmentsSource = source;
```

> caption AgendaViewDefinition

![WPF RadScheduleView AgendaViewDefinition](https://www.telerik.com/products/wpf/documentation/assets/8911389a108fdb2218d84d9b44004070/radscheduleview-viewdefinition-agenda-0.png)

## Number of Visible Days

To set the number of visible days, set the **VisibleDays** property of AgendaViewDefinition. This determines how many rows with days will be visible in the current view.

**Example 3: Setting visible days number**

```XAML
<telerik:RadScheduleView.ViewDefinitions>
    <telerik:AgendaViewDefinition VisibleDays="2" />
</telerik:RadScheduleView.ViewDefinitions>
```

The default value of VisibleDays is 7.

> caption AgendaViewDefinition with 2 visible days

![WPF RadScheduleView AgendaViewDefinition with 2 visible days](https://www.telerik.com/products/wpf/documentation/assets/44ebd5adb53a4ff2e6c5d06e544de432/radscheduleview-viewdefinition-agenda-1.png)

## Hide Empty Days

The agenda view displays empty days by default. You can alter this behavior and hide days that don't contain appointments, by setting the **ShowEmptyDays** property to **False**.

**Example 4: Hiding empty days**

```XAML
<telerik:RadScheduleView.ViewDefinitions>
    <telerik:AgendaViewDefinition ShowEmptyDays="False" />
</telerik:RadScheduleView.ViewDefinitions>
```

> caption Setting ShowEmptyDays with appointments (comparison)

![WPF RadScheduleView Setting ShowEmptyDays with appointments (comparison)](https://www.telerik.com/products/wpf/documentation/assets/1b77ab903184308434a1e109ad4bbdc4/radscheduleview-viewdefinition-agenda-2.png)

> caption Setting ShowEmptyDays without appointments (comparison)

![WPF RadScheduleView Setting ShowEmptyDays without appointments (comparison)](https://www.telerik.com/products/wpf/documentation/assets/e7b261a5bed2574f3286c13688485d25/radscheduleview-viewdefinition-agenda-3.png)

## See Also

* [Getting Started](https://www.telerik.com/products/wpf/documentation/controls/radscheduleview/getting-started/getting-started)
* [ViewDefinitions Overview](https://www.telerik.com/products/wpf/documentation/controls/radscheduleview/features/viewdefinitions/overview)
* [ViewDefinitions Configuration](https://www.telerik.com/products/wpf/documentation/controls/radscheduleview/features/viewdefinitions/configuration)
