AppointmentDisplayOptions.SnapToCellsMode Property

Gets or sets the method of snapping appointments to time cells.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v19.2.Core.dll

Declaration

public virtual AppointmentSnapToCellsMode SnapToCellsMode { get; set; }
Public Overridable Property SnapToCellsMode As AppointmentSnapToCellsMode

Property Value

Type Description
AppointmentSnapToCellsMode

A AppointmentSnapToCellsMode enumeration member, specifying the snap method.

Remarks

When snapping mode is set to Auto, an appointment is stretched to fill the cell(s) if its time interval does not include an entire cell. Different snap modes in the TimelineView are illustrated in the following pictures:

  • SnapToCellsMode = Always

    An appointment is always stretched to cell borders so that it occupies the entire cell or several cells.

    SnapToCellMode-Always

  • SnapToCellsMode = Auto

    Appointment is stretched to cell border only if a distance from the cell border to the edge of an appointment is less than half of the cell width.

    SnapToCellMode-Auto

    NOTE

    In the Day-like views (Day, Full Week and Work Week views), the SnapToCellsMode property set to Auto may subsequently affect the appointment's start and end time visibility, specified by the AppointmentDisplayOptions.StartTimeVisibility and the AppointmentDisplayOptions.EndTimeVisibility. With these properties set to Auto, the appointment start and end time will be displayed regardless of its alignment within the time cell.

  • SnapToCellsMode = Never

    SnapToCellMode-Never

  • SnapToCellsMode = Disabled

    The appointment visible width is proportional to its duration. The minimal value of a dimension that represents the appointment duration is one pixel. The following picture illustrates the difference between the Disabled and Never modes for the appointment with a very small duration. The Never mode has a minimal width of several pixels to display an appointment, so an appointment will never appear as a line segment. The Disabled mode has a minimal width of one pixel, so you can distinguish between small appointments which have the same width in the Never mode, as illustrated in the following picture. In the Never mode, appointments with a very small duration are displayed as line segments.

    SnapToCellMode-Never-Disabled

To display appointments on the same line, you should set the SnapToCellsMode to Disabled. You may also need to adjust the timeline scale's TimeScale.Width and set the AppointmentDisplayOptions.StartTimeVisibility and the AppointmentDisplayOptions.EndTimeVisibility to AppointmentTimeVisibility.Never.

For Day View and Work Week View views, the actual duration is indicated by colorizing the left border of the appointment if the AppointmentDisplayOptions.StatusDisplayType is set to AppointmentStatusDisplayType.Time. Snap modes for the DayView are illustrated below.

  • SnapToCellsMode = Always

    SnapToCellDayViewAlways

  • SnapToCellsMode = Auto

    SnapToCellDayViewAuto

  • SnapToCellsMode = Never

    SnapToCellDayViewNever

  • SnapToCellsMode = Disabled

    SnapToCells_Disabled

See Also