Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SchedulerSnapToCellsMode Enum

Lists values that specify how appointments snap to time cells.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public enum SchedulerSnapToCellsMode

#Members

Name Description
Auto

Appointments that occupy less than two time cells stretch to the cell borders. The remaining appointments do not stretch.

Always

Appointments always stretch to cell borders and always occupy the entire cell.

Never

Appointments do not stretch.

#Related API Members

The following properties accept/return SchedulerSnapToCellsMode values:

#Remarks

You can specify whether appointments stretch to cell borders. Pass the SchedulerSnapToCellsMode enumeration values to the corresponding view’s property to select the stretch mode.

In the following image, the SnapToCellsMode property is set to Never:

Appointments do not stretch

In the image below, the SnapToCellsMode property is set to Always:

Appointments always stretch

In the last image, the SnapToCellsMode property is set to Auto:

Auto stretching

The following code snippet applies the SnapToCellsMode property to the Timeline view:

Razor
<DxScheduler StartDate="@DateTime.Today"
             DataStorage="@DataStorage">
    <DxSchedulerTimelineView SnapToCellsMode="SchedulerSnapToCellsMode.Always"
                             Duration="@(TimeSpan.FromHours(24))"
                             CellMinWidth="100">
        <Scales>
            <DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Day" UnitCount="1"></DxSchedulerTimeScale>
            <DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Hour" UnitCount="4"></DxSchedulerTimeScale>
        </Scales>
    </DxSchedulerTimelineView>
</DxScheduler>

@code {
    DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage()
    {
        AppointmentsSource = GetAppointments(),
        AppointmentMappings = new DxSchedulerAppointmentMappings()
        {
            Type = "AppointmentType",
            Start = "StartDate",
            End = "EndDate",
            Subject = "Caption",
            AllDay = "AllDay",
            Location = "Location",
            Description = "Description",
            LabelId = "Label",
            StatusId = "Status",
            RecurrenceInfo = "Recurrence"
        }
    };
    @* ... *@
}
See Also