New to Telerik UI for WinForms? Start a free 30-day trial

Coordinates interactive appointment resizing and raises notifications for the start, intermediate changes, and completion.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

C#
public class AppointmentResizingBehavior

Inheritance: objectAppointmentResizingBehavior

Constructors

Initializes the behavior for the specified Scheduler.

C#
public AppointmentResizingBehavior(RadScheduler scheduler)
Parameters:schedulerRadScheduler

The Scheduler whose appointments can be resized.

Initializes the behavior with the visual element that owns the appointment being resized.

C#
public AppointmentResizingBehavior(SchedulerVisualElement activeOwner)
Parameters:activeOwnerSchedulerVisualElement

The Scheduler visual element that owns the appointment.

Fields

Indicates that the bottom edge is the active resize edge.

C#
protected bool downResize

Indicates that the left edge is the active resize edge.

C#
protected bool leftResize

Stores the resize offset supplied through the current ResizeOptions.

C#
protected float resizeStepOffset

Indicates that the right edge is the active resize edge.

C#
protected bool rightResize

Indicates that the top edge is the active resize edge.

C#
protected bool upResize

Properties

Gets or sets the active resizing appointment.

C#
public IEvent ActiveAppointment { get; }

Gets or sets a value indicating whether the appointment areas in DayView should be automatically scrolled when dragging off their bounds.

C#
public bool AutoScrollDayViewOnResize { get; set; }

Gets or sets the bounds offset which specifies the size of the sizing rectangles.

C#
public int CursorBoundsOffset { get; set; }

Gets or sets whether the user is currently resizing the active appointment.

C#
public virtual bool IsResizing { get; }

Gets or sets the resize minutes.

C#
public int ResizeMinutes { get; set; }

Methods

Ends the resize operation for the active appointment.

C#
public bool EndResize()
Returns:

bool

true if an active resize was ended; otherwise, false.

Ends the appointment resizing.

C#
public virtual bool EndResize(IEvent appointment)
Parameters:appointmentIEventReturns:

bool

Gets the endpoint-change details recorded by the most recent resize adjustment.

C#
public ResizeInformation GetResizeInformation()
Returns:

ResizeInformation

The recorded old and new dates and resize direction, or null if no endpoint has changed.

Builds resize orientation, offset, and minute-step settings from the type and layout of the active view owner.

C#
protected virtual ResizeOptions GetResizeOptions(SchedulerVisualElement owner)
Parameters:ownerSchedulerVisualElement

The visual element that owns the appointment.

Returns:

ResizeOptions

The resize settings derived from the owner, or default settings when the owner is null.

Changes the appointment's start or end date to the target cell boundary, subject to cancellation and recurrence validation.

C#
protected virtual bool HandleAppointmentHorizontalResize(SchedulerCellElement cell, IEvent appointment)
Parameters:cellSchedulerCellElement

The cell containing the proposed endpoint.

appointmentIEvent

The appointment being resized.

Returns:

bool

true when an endpoint change is accepted and applied.

Changes the appointment's start or end time to the target cell boundary, subject to cancellation and recurrence validation.

C#
protected virtual bool HandleAppointmentVerticalResize(SchedulerCellElement cell, IEvent appointment)
Parameters:cellSchedulerCellElement

The cell containing the proposed endpoint.

appointmentIEvent

The appointment being resized.

Returns:

bool

true when an endpoint change is accepted and applied.

Raises AppointmentResized with the appointment's resize notification data.

C#
protected virtual void OnAppointmentResized(AppointmentResizedEventArgs args)
Parameters:argsAppointmentResizedEventArgs

The appointment resize event data.

Raises AppointmentResizing before resize processing; handlers can cancel the operation.

C#
protected virtual void OnAppointmentResizing(AppointmentResizingEventArgs cancelArgs)
Parameters:cancelArgsAppointmentResizingEventArgs

The appointment event data and cancellation state.

Raises the completion event and notifies the Scheduler that resizing has ended.

C#
protected virtual void OnFinished(IEvent appointment)
Parameters:appointmentIEvent

The appointment whose resize has finished.

Raises the initialization event and asks the Scheduler whether the resize may start.

C#
protected virtual bool OnInitialized()
Returns:

bool

true if the Scheduler did not cancel the resize.

Requests a resize start.

C#
public bool RequestResize(AppointmentElement appointment, SchedulerVisualElement newOwner, bool start)
Parameters:appointmentAppointmentElementnewOwnerSchedulerVisualElementstartboolReturns:

bool

Requests a resize start.

C#
public virtual bool RequestResize(AppointmentElement appointment, SchedulerVisualElement newOwner, Point cursorPosition, ResizeOptions resizeOptions, bool start)
Parameters:appointmentAppointmentElementnewOwnerSchedulerVisualElementcursorPositionPointresizeOptionsResizeOptionsstartboolReturns:

bool

Requests a resize start.

C#
public bool RequestResize(AppointmentElement appointment, SchedulerVisualElement newOwner, Point cursorPosition, ResizeOptions resizeOptions)
Parameters:appointmentAppointmentElementnewOwnerSchedulerVisualElementcursorPositionPointresizeOptionsResizeOptionsReturns:

bool

Requests a resize start.

C#
public bool RequestResize(AppointmentElement appointment, SchedulerVisualElement newOwner)
Parameters:appointmentAppointmentElementnewOwnerSchedulerVisualElementReturns:

bool

Resizes an appointment to a given position.

C#
public virtual bool Resize(Point mousePosition, IEvent appointment)
Parameters:mousePositionPointappointmentIEventReturns:

bool

Resizes an appointment to a given position.

C#
public virtual bool Resize(Point mousePosition)
Parameters:mousePositionPointReturns:

bool

Represents the horizontal resizing.

C#
protected virtual bool ResizeHorizontally(Point mousePosition, IEvent appointment)
Parameters:mousePositionPointappointmentIEventReturns:

bool

Represents the vertical resizing.

C#
protected virtual bool ResizeVertically(Point mousePosition, IEvent appointment)
Parameters:mousePositionPointappointmentIEventReturns:

bool

Sets the Scheduler cursor to the resize cursor for the active orientation, or resets it when no resize is active.

C#
protected virtual void UpdateMouseCursor()

Updates the current mouse cursor.

C#
protected virtual bool UpdateMouseCursor(Point mousePosition, Rectangle nearRect, Rectangle farRect)
Parameters:mousePositionPoint

The current position

nearRectRectangle

The top or left area of the appointment which can start a resize

farRectRectangle

The bottom or right area of the appointment which can start a resize

Returns:

bool

True if the mouse position is in a resize location, false otherwise.

Updates the behavior's orientation, resize offset, and minute-step settings from the supplied options.

C#
public void UpdateResizeOptions(ResizeOptions resizeOptions)
Parameters:resizeOptionsResizeOptions

The settings to apply to subsequent resize operations.

Checks the proposed interval against other occurrences in the active view, rejecting it if another occurrence's start or end falls inside it.

C#
protected virtual bool ValidateExceptionDates(IEvent resized, DateTime startDate, TimeSpan duration)
Parameters:resizedIEvent

The recurring appointment occurrence being resized.

startDateDateTime

The proposed start date.

durationTimeSpan

The proposed duration.

Returns:

bool

true when the current occurrence-boundary check passes.

Events

Occurs when the appointment is resized.

C#
public event EventHandler<AppointmentResizedEventArgs> AppointmentResized

Occurs when the appointment is resizing.

C#
public event EventHandler<AppointmentResizingEventArgs> AppointmentResizing

Occurs when the resizing operation is finished.

C#
public event EventHandler<SchedulerAppointmentEventArgs> Finished

Occurs when the rezing request is initialized.

C#
public event EventHandler Initialized