Class SchedulerDayViewElement
Represents the main visual element of RadScheduler when in SchedulerDayView mode, providing a time-based grid layout for displaying and managing appointments across one or more days.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.Scheduler.dll
Syntax
public class SchedulerDayViewElement : SchedulerViewElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Constructors
SchedulerDayViewElement(RadScheduler, SchedulerView)
Initializes a new instance of the SchedulerDayViewElement class with the specified scheduler control and view configuration.
Declaration
public SchedulerDayViewElement(RadScheduler scheduler, SchedulerView view)
Parameters
RadScheduler
scheduler
The RadScheduler control that owns this view element. |
SchedulerView
view
The SchedulerView configuration that this element represents. |
Fields
AppointmentMarginProperty
Properties
AllDayHeaderElement
Gets the all-day appointments header element that manages and displays appointments spanning entire days at the top of the view.
Declaration
public DayViewAllDayHeader AllDayHeaderElement { get; }
Property Value
DayViewAllDayHeader
|
AllDayHeaderHeight
Gets or sets the height in pixels of the all-day appointments header section that displays appointments spanning entire days.
Declaration
public int AllDayHeaderHeight { get; set; }
Property Value
System.Int32
|
AppointmentMargin
Gets or sets the spacing margin applied around appointment elements to provide visual separation and improve readability.
Declaration
[VsbBrowsable(true)]
public override Padding AppointmentMargin { get; set; }
Property Value
System.Windows.Forms.Padding
|
Overrides
DataAreaElement
Gets the appointments area element that contains the time grid, time slots, and displays all scheduled appointments within the day view.
Declaration
public DayViewAppointmentsArea DataAreaElement { get; }
Property Value
DayViewAppointmentsArea
|
HeaderElement
Gets the day view header element that displays date headers and column information for each visible day in the view.
Declaration
public DayViewHeader HeaderElement { get; }
Property Value
DayViewHeader
|
Methods
ArrangeOverride(SizeF)
Arranges and positions the child elements within the specified final size, including headers, appointment area, and navigation elements.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
System.Drawing.SizeF
finalSize
The final size allocated for this element. |
Returns
System.Drawing.SizeF
The actual size used by the element. |
Overrides
CreateChildElements()
Creates and initializes the child elements for this day view element, setting the appropriate CSS class.
Declaration
protected override void CreateChildElements()
Overrides
EnsureAppointmentVisible(AppointmentElement)
Scrolls the view to ensure that a specified appointment is visible within the control's viewport. If the appointment is already visible, no scrolling occurs.
Declaration
public void EnsureAppointmentVisible(AppointmentElement appointment)
Parameters
AppointmentElement
appointment
The AppointmentElement to make visible. |
EnsureCellVisible(SchedulerCellElement)
Scrolls the view to ensure that a specified cell is visible within the control's viewport. If the cell is already visible, no scrolling occurs.
Declaration
public void EnsureCellVisible(SchedulerCellElement cell)
Parameters
SchedulerCellElement
cell
The SchedulerCellElement to make visible. |
GetCellAtPosition(Int32, Int32)
Gets the scheduler cell element at the specified row and column position in the day view grid.
Declaration
public override SchedulerCellElement GetCellAtPosition(int row, int column)
Parameters
System.Int32
row
The row position in the grid. |
System.Int32
column
The column position in the grid. |
Returns
SchedulerCellElement
The SchedulerCellElement at the specified position, or null if no cell exists. |
Overrides
GetCellContainers()
Gets a list of all cell containers that are part of this day view element, including the data area table, header, and all-day header.
Declaration
public override List<SchedulerCellContainer> GetCellContainers()
Returns
System.Collections.Generic.List<SchedulerCellContainer>
A list of SchedulerCellContainer objects representing all cell containers in the view. |
Overrides
GetCellCoordinates(SchedulerCellElement)
Gets the table layout coordinates for the specified scheduler cell element within the day view structure.
Declaration
public override TableLayoutPanelCellPosition GetCellCoordinates(SchedulerCellElement cell)
Parameters
SchedulerCellElement
cell
The SchedulerCellElement to get coordinates for. |
Returns
System.Windows.Forms.TableLayoutPanelCellPosition
The System.Windows.Forms.TableLayoutPanelCellPosition representing the cell's position in the layout. |
Overrides
GetColumnForDate(DateTime)
Gets the zero-based column index that corresponds to a given date in the day view.
Declaration
public int GetColumnForDate(DateTime dateTime)
Parameters
System.DateTime
dateTime
The date to find the column for. |
Returns
System.Int32
The zero-based column index corresponding to the specified date, or -1 if the date is not in the current view. |
GetColumnHorizontalOffset(Int32, Single)
Gets the horizontal offset in pixels of the column with a specified index relative to the left edge of the first column.
Declaration
public float GetColumnHorizontalOffset(int columnIndex, float availableWidth)
Parameters
System.Int32
columnIndex
The zero-based column index. |
System.Single
availableWidth
The total width available for all columns. |
Returns
System.Single
The horizontal offset of the specified column in pixels. |
GetColumnsWidth(Int32, Int32, Single)
Gets the total combined width in pixels of a range of consecutive columns given their indices.
Declaration
public float GetColumnsWidth(int startColumn, int endColumn, float availableWidth)
Parameters
System.Int32
startColumn
The index of the first column in the range. |
System.Int32
endColumn
The index of the last column in the range (inclusive). |
System.Single
availableWidth
The total width available for all columns. |
Returns
System.Single
The combined width of the specified column range in pixels. |
GetColumnWidth(Int32)
Gets the proportional width value for a column as set by the SetColumnWidth(Int32, Single) method. The actual width of a column is calculated proportionally according to the values other columns have. The default value of each column is 1.0, meaning that setting a value of 2.0 for a given column will make it twice as large compared to other columns. To get the width of a column in pixels use the GetColumnWidth(Int32, Single) overload.
Declaration
public float GetColumnWidth(int columnIndex)
Parameters
System.Int32
columnIndex
The zero-based column index. |
Returns
System.Single
The proportional width value of the specified column. |
GetColumnWidth(Int32, Single)
Gets the calculated width in pixels of the column with a specified index based on the available space and column proportions.
Declaration
public float GetColumnWidth(int columnIndex, float availableWidth)
Parameters
System.Int32
columnIndex
The zero-based column index. |
System.Single
availableWidth
The total width available for all columns. |
Returns
System.Single
The calculated width of the specified column in pixels. |
GetDateForCell(Int32, Int32)
Gets the date and time that corresponds to a specific cell in the day view grid.
Declaration
public DateTime GetDateForCell(int row, int column)
Parameters
System.Int32
row
The row index of the cell. |
System.Int32
column
The column index of the cell. |
Returns
System.DateTime
The System.DateTime corresponding to the specified cell. |
GetDateForColumn(Int32)
Gets the date that corresponds to a specific column in the day view.
Declaration
public DateTime GetDateForColumn(int column)
Parameters
System.Int32
column
The zero-based column index. |
Returns
System.DateTime
The System.DateTime corresponding to the specified column. |
GetLeftOffset()
Gets the total width in pixels of all rulers displayed on the left side of the day view.
Declaration
public virtual float GetLeftOffset()
Returns
System.Single
The combined width of all rulers in pixels. |
GetRightOffset()
Gets the width in pixels of the vertical scrollbar on the right side of the day view when visible.
Declaration
public virtual float GetRightOffset()
Returns
System.Single
The width of the scrollbar if visible, otherwise 0. |
InitializeChildren()
Initializes and creates all child elements including headers, appointment areas, and navigation elements for the day view.
Declaration
protected virtual void InitializeChildren()
IsAllDayAreaAppointment(IEvent)
Determines whether an appointment should be displayed in the all-day area of the SchedulerDayViewElement based on its duration and characteristics.
Declaration
public virtual bool IsAllDayAreaAppointment(IEvent appointment)
Parameters
IEvent
appointment
The IEvent appointment to evaluate. |
Returns
System.Boolean
True if the appointment should be displayed in the all-day area; otherwise, false. |
IsAppointmentElementInView(AppointmentElement)
Determines whether the specified appointment element should be visible and displayed in the current day view based on its date range.
Declaration
public virtual bool IsAppointmentElementInView(AppointmentElement appointment)
Parameters
AppointmentElement
appointment
The AppointmentElement to check. |
Returns
System.Boolean
True if the appointment should be visible in the current view; otherwise, false. |
MeasureOverride(SizeF)
Measures the size required by this element and its child elements based on the available size.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
System.Drawing.SizeF
availableSize
The available size for the element. |
Returns
System.Drawing.SizeF
The desired size of the element. |
Overrides
OnLoaded()
Called when the element is loaded and performs initial setup including auto-scrolling to work time if configured.
Declaration
protected override void OnLoaded()
Overrides
OnViewPropertyChanged(Object, PropertyChangedEventArgs)
Handles property changes from the associated scheduler view and updates the visual elements accordingly.
Declaration
protected override void OnViewPropertyChanged(object sender, PropertyChangedEventArgs e)
Parameters
System.Object
sender
The object that raised the event. |
System.ComponentModel.PropertyChangedEventArgs
e
The System.ComponentModel.PropertyChangedEventArgs containing information about the changed property. |
Overrides
Scroll(Boolean)
Scrolls the day view's appointment table vertically in the specified direction.
Declaration
public override void Scroll(bool up)
Parameters
System.Boolean
up
True to scroll up, false to scroll down. |
Overrides
ScrollToTime(TimeSpan)
Scrolls the DayViewAppointmentsTable to display a specified time of the day in the visible area.
Declaration
public void ScrollToTime(TimeSpan time)
Parameters
System.TimeSpan
time
The time of the day to scroll to. |
ScrollToWorkHours()
Scrolls the DayViewAppointmentsTable to display the start of the working hours as defined in the scheduler configuration.
Declaration
public void ScrollToWorkHours()
SetColumnWidth(Int32, Single)
Sets the proportional width value for a column. The actual width of a column is calculated proportionally according to the values other columns have. The default value of each column is 1.0. This means that setting a value of 2.0 for a given column will make it twice as large compared to other columns.
Declaration
public void SetColumnWidth(int columnIndex, float value)
Parameters
System.Int32
columnIndex
The index of the column to resize. |
System.Single
value
The proportional value according to which the actual width will be calculated. |