Back to Devexpress

DxSchedulerTimelineView.SnapToCellsMode Property

blazor-devexpress-dot-blazor-dot-dxschedulertimelineview-2b258382.md

latest3.1 KB
Original Source

DxSchedulerTimelineView.SnapToCellsMode Property

Specifies how appointments snap to time cells in the Timeline view.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public SchedulerSnapToCellsMode SnapToCellsMode { get; set; }

Property Value

TypeDescription
SchedulerSnapToCellsMode

A SchedulerSnapToCellsMode enumeration value.

|

Available values:

NameDescription
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.

|

Remarks

Use the SnapToCellsMode property to specify how appointments stretch.

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

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

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

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

DxSchedulerTimelineView Class

DxSchedulerTimelineView Members

DevExpress.Blazor Namespace