Back to Devexpress

AppointmentViewInfo.StatusDisplayType Property

windowsforms-devexpress-dot-xtrascheduler-dot-drawing-dot-appointmentviewinfo-4522b237.md

latest5.2 KB
Original Source

AppointmentViewInfo.StatusDisplayType Property

Gets or sets whether the border of an appointment should be colorized according to the status and appointment duration.

Namespace : DevExpress.XtraScheduler.Drawing

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public AppointmentStatusDisplayType StatusDisplayType { get; set; }
vb
Public Property StatusDisplayType As AppointmentStatusDisplayType

Property Value

TypeDescription
AppointmentStatusDisplayType

An AppointmentStatusDisplayType enumeration specifying how the status is displayed.

|

Available values:

NameDescription
Never

The appointment status line is invisible.

| | Time |

The appointment status line has the same height (if shown vertically) or width (if shown horizontally) as the time of its appointment.

| | Bounds |

The appointment status line has the same height (if shown vertically) or width (if shown horizontally) as the appointment bounds.

|

Remarks

The StatusDisplayType property specifies how the status is displayed for a particular appointment. Subscribe to the SchedulerControl.AppointmentViewInfoCustomizing event and use the e.ViewInfo.StatusDisplayType notation.

Tip

To specify the status display type for all appointments, use the AppointmentDisplayOptions.StatusDisplayType property.

Example

This code illustrates how to handle the SchedulerControl.AppointmentViewInfoCustomizing event to change the AppointmentViewInfo.StatusDisplayType for an appointment whose Appointment.Description contains a particular string.

For better visibility, the DayViewAppointmentDisplayOptionsEx.ShowAllDayAppointmentStatusVertically property is set to false.

csharp
Appointment apt = scheduler.ActiveView.GetAppointments()[0];
    apt.End = apt.End.AddDays(1);
    apt.Description = "Time";
    scheduler.ActiveViewType = SchedulerViewType.Day;
    scheduler.DayView.AppointmentDisplayOptions.AllDayAppointmentsStatusDisplayType = AppointmentStatusDisplayType.Bounds;
    scheduler.DayView.AppointmentDisplayOptions.ShowAllDayAppointmentStatusVertically = false;
    scheduler.AppointmentViewInfoCustomizing += scheduler_AppointmentViewInfoCustomizing;

public static void scheduler_AppointmentViewInfoCustomizing(object sender, AppointmentViewInfoCustomizingEventArgs e) {
    if (e.ViewInfo.Description.Contains("Time"))
        e.ViewInfo.StatusDisplayType = AppointmentStatusDisplayType.Time;
}
vb
Dim apt As Appointment = scheduler.ActiveView.GetAppointments()(0)
    apt.End = apt.End.AddDays(1)
    apt.Description = "Time"
    scheduler.ActiveViewType = SchedulerViewType.Day
    scheduler.DayView.AppointmentDisplayOptions.AllDayAppointmentsStatusDisplayType = AppointmentStatusDisplayType.Bounds
    scheduler.DayView.AppointmentDisplayOptions.ShowAllDayAppointmentStatusVertically = False
    AddHandler scheduler.AppointmentViewInfoCustomizing, AddressOf scheduler_AppointmentViewInfoCustomizing

Public Shared Sub scheduler_AppointmentViewInfoCustomizing_1(ByVal sender As Object, ByVal e As AppointmentViewInfoCustomizingEventArgs)
    If e.ViewInfo.Description.Contains("Time") Then
        e.ViewInfo.StatusDisplayType = AppointmentStatusDisplayType.Time
    End If
End Sub

See Also

StatusDisplayType

AppointmentViewInfo Class

AppointmentViewInfo Members

DevExpress.XtraScheduler.Drawing Namespace