Back to Devexpress

DayView.TimeSlots Property

windowsforms-devexpress-dot-xtrascheduler-dot-dayview-fbab5f8a.md

latest2.7 KB
Original Source

DayView.TimeSlots Property

Gets the View’s collection of time slots.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
[XtraSerializableProperty(XtraSerializationVisibility.Collection, true, false, true)]
public TimeSlotCollection TimeSlots { get; }
vb
<XtraSerializableProperty(XtraSerializationVisibility.Collection, True, False, True)>
Public ReadOnly Property TimeSlots As TimeSlotCollection

Property Value

TypeDescription
TimeSlotCollection

A TimeSlotCollection object that represents a time slot collection.

|

Remarks

Use the TimeSlots property to specify the time intervals of time cells available for end-user selection in the Day View.

The TimeSlots property provides access to the TimeSlotCollection object which represents a collection of time slots within the Day View. The collection’s properties and methods can be used to manipulate individual collection items (instances of the TimeSlot class).

To add a custom time slot to the collection, add default time slots first and then add a custom time slot, as illustrated in the following code snippet:

csharp
// Add 20-minute time slots to the view.
scheduler.DayView.TimeSlots.AddRange(scheduler.DayView.DefaultTimeSlots);
scheduler.DayView.TimeSlots.Add(new DevExpress.XtraScheduler.TimeSlot(new TimeSpan(0, 20, 0), "20 minutes"));
vb
' Add 20-minute time slots to the view.
scheduler.DayView.TimeSlots.AddRange(scheduler.DayView.DefaultTimeSlots)
scheduler.DayView.TimeSlots.Add(New DevExpress.XtraScheduler.TimeSlot(New TimeSpan(0, 20, 0), "20 minutes"))

See Also

DayView Class

DayView Members

DevExpress.XtraScheduler Namespace