Back to Devexpress

SchedulerControl.SelectedAppointments Property

wpf-devexpress-dot-xpf-dot-scheduling-dot-schedulercontrol-2c268657.md

latest3.5 KB
Original Source

SchedulerControl.SelectedAppointments Property

Provides access to the selected appointments.

Namespace : DevExpress.Xpf.Scheduling

Assembly : DevExpress.Xpf.Scheduling.v25.2.dll

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public ObservableCollection<AppointmentItem> SelectedAppointments { get; }
vb
Public ReadOnly Property SelectedAppointments As ObservableCollection(Of AppointmentItem)

Property Value

TypeDescription
ObservableCollection<AppointmentItem>

A collection of AppointmentItem objects.

|

Remarks

Use the SelectedAppointments property to obtain the currently selected appointments.

To provide a source to the selected appointments, use the SchedulerControl.SelectedAppointmentsSource property.

The following code snippet demonstrates how to display the selected appointment’s subject values in an application.

View Example: Obtain Selected Appointment, Resource, and Time Interval

xaml
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto">
    <ItemsControl ItemsSource="{DXBinding '@e(schedulerControl).SelectedAppointments'}">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <TextBox Background="Beige" Text="{Binding Subject}" />
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</ScrollViewer>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SelectedAppointments property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-scheduler-customize-context-menus/CS/DXScheduler_PopUpMenuCustomization/MainWindow.xaml.cs#L12

csharp
private void allDayCheck_CheckedChanged(object sender, ItemClickEventArgs e) {
    AppointmentItem selectedItem = scheduler.SelectedAppointments[0];
    selectedItem.AllDay = (allDayCheck.IsChecked == true) ? true : false;

See Also

Selection

SchedulerControl Class

SchedulerControl Members

DevExpress.Xpf.Scheduling Namespace