Back to Devexpress

DayViewBase.SnapToCellsMode Property

wpf-devexpress-dot-xpf-dot-scheduling-dot-dayviewbase-d9b14d13.md

latest4.0 KB
Original Source

DayViewBase.SnapToCellsMode Property

Gets or sets the method of snapping appointments to time cells in the Day View, Work Week View, and Week View. This is a dependency property.

Namespace : DevExpress.Xpf.Scheduling

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

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public SnapToCellsMode SnapToCellsMode { get; set; }
vb
Public Property SnapToCellsMode As SnapToCellsMode

Property Value

TypeDescription
SnapToCellsMode

A SnapToCellsMode enumeration member specifying the snap method.

|

Available values:

NameDescription
Auto

Appointment is stretched to a cell border only if the appointment start and end are located in the same cell or in adjacent cells.

| | Always |

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

| | Never |

The appointment visible width is proportional to its duration. However, there is a minimal visible width (TimelineView.AppointmentMinWidth) or height (DayViewBase.AppointmentMinHeight). If an appointment’s duration is quite small, it will never be narrower than the minimal value.

|

Remarks

The images below demonstrate different snap modes for the Day View:

The following code snippets (auto-collected from DevExpress Examples) contain references to the SnapToCellsMode 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-highlight-time-intervals/CS/SchedulerCellTemplate/MainWindow.xaml#L30

xml
TimeRegionVisibility="{DXBinding Expr='HighlightLunchHours? $dxsch:TimeRegionVisibility.Always : $dxsch:TimeRegionVisibility.Never'}"
    SnapToCellsMode="Never" DayCount="5" TimeScale="00:30:00" />
<dxsch:SchedulerControl.DataSource>

wpf-scheduler-process-appointment-drag-drop-resize-operations/CS/SchedulerDragDropResizeExample/MainWindow.xaml#L83

xml
</dxsch:SchedulerControl.DataSource>
<dxsch:DayView ResourcesPerPage="3" ShowWorkTimeOnly="True" SnapToCellsMode="Never" />
<dxsch:MonthView />

See Also

DayViewBase Class

DayViewBase Members

DevExpress.Xpf.Scheduling Namespace