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

Reorders Panorama tiles and scrolls the view automatically while a tile is dragged near a horizontal edge.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class TileDragDropService : RadDragDropService, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IMessageListener

Inheritance: objectDisposableObjectRadObjectRadServiceRadDragDropServiceTileDragDropService...

Implements: ICustomTypeDescriptorIDisposableIMessageListenerINotifyPropertyChanged

Inherited Members RadDragDropService.messageFilterAddedRadDragDropService.xOutlineFormOffsetRadDragDropService.yOutlineFormOffsetRadDragDropService.beginPointRadDragDropService.DisposeManagedResources()RadDragDropService.HandleLeftButtonUp()RadDragDropService.HandleEscKeyDown()RadDragDropService.OnPreviewDragHint(PreviewDragHintEventArgs)RadDragDropService.OnPreviewDragOver(RadDragOverEventArgs)RadDragDropService.RestoreOriginalMouseCursor()RadDragDropService.SetHintWindowPosition(Point)RadDragDropService.ShouldBeginDrag(Point, Point)RadDragDropService.OnPreviewDragStart(PreviewDragStartEventArgs)RadDragDropService.PerformStart()RadDragDropService.Commit()RadDragDropService.OnPreviewDropTarget(PreviewDropTargetEventArgs)RadDragDropService.BeginDrag(Point, ISupportDrag)RadDragDropService.EndDrag(Point, RadControl)RadDragDropService.EndDrag()RadDragDropService.DoMouseMove(Point)RadDragDropService.CanCommitRadDragDropService.ValidCursorRadDragDropService.InitializedRadDragDropService.InvalidCursorRadDragDropService.UseDefaultPreviewRadDragDropService.DropTargetRadDragDropService.DropLocationRadDragDropService.HintWindowRadDragDropService.PreviewDragDropRadDragDropService.PreviewDragOverRadDragDropService.PreviewDropTargetRadDragDropService.PreviewDragStartRadDragDropService.PreviewDragHintRadService.CanOperate()RadService.Start(object)RadService.Stop(bool)RadService.Pause()RadService.Resume()RadService.OnStarted()RadService.OnStarting(RadServiceStartingEventArgs)RadService.OnStopped()RadService.OnStopping(RadServiceStoppingEventArgs)RadService.IsContextValid(object)RadService.Abort()RadService.PerformResume()RadService.PerformPause()RadService.SetContext(object)RadService.OnEnabledChanged()RadService.ContextRadService.AvailableAtDesignTimeRadService.StateRadService.NameRadService.EnabledRadService.StartingRadService.StartedRadService.StoppingRadService.StoppedRadObject.BindingContextPropertyRadObject.RadTypeRadObject.ReplaceDefaultDescriptors(PropertyDescriptorCollection)RadObject.ClearPropertyStore()RadObject.SuspendPropertyNotifications()RadObject.ResumePropertyNotifications()RadObject.GetPropertyValue(RadProperty)RadObject.SetDefaultValueOverride(RadProperty, object)RadObject.GetValue(RadProperty)RadObject.SetValue(RadProperty, object)RadObject.ResetValue(RadProperty)RadObject.ResetLocalValue(RadProperty)RadObject.ResetValue(RadProperty, ValueResetFlags)RadObject.UpdateValue(RadProperty)RadObject.GetValueSource(RadProperty)RadObject.GetRegisteredRadProperty(string)RadObject.UpdateValueCore(RadPropertyValue)RadObject.SetValueCore(RadPropertyValue, object, object, ValueSource)RadObject.ResetValueCore(RadPropertyValue, ValueResetFlags)RadObject.GetDefaultValue(RadPropertyValue, object)RadObject.CoerceValue(RadPropertyValue, object)RadObject.ShouldSerializeProperty(RadProperty)RadObject.CanRaisePropertyChangeNotifications(RadPropertyValue)RadObject.BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)RadObject.UnbindProperty(RadProperty)RadObject.AddStylePropertySetting(IPropertySetting)RadObject.GetInheritedValue(RadProperty)RadObject.OnPropertyChanging(RadPropertyChangingEventArgs)RadObject.OnPropertyChanged(RadPropertyChangedEventArgs)RadObject.OnNotifyPropertyChanged(string)RadObject.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadObject.OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)RadObject.IsPropertyCancelable(RadPropertyMetadata)RadObject.PropertyValuesRadObject.PropertyFilterRadObject.RadObjectTypeRadObject.BindingContextRadObject.PropertyChangedRadObject.RadPropertyChangedRadObject.RadPropertyChangingDisposableObject.GetBitState(long)DisposableObject.SetBitState(long, bool)DisposableObject.OnBitStateChanged(long, bool, bool)DisposableObject.Dispose()DisposableObject.Dispose(bool)DisposableObject.PerformDispose(bool)DisposableObject.DisposeUnmanagedResources()DisposableObject.BitStateDisposableObject.EventsDisposableObject.IsDisposingDisposableObject.IsDisposedDisposableObject.DisposedDisposableObject.Disposing...

Constructors

Initializes the drag-and-drop service for a Panorama element.

C#
public TileDragDropService(RadPanoramaElement owner)
Parameters:ownerRadPanoramaElement

The Panorama whose tiles can be reordered.

Properties

Gets or sets the offset from the edges of the control at which automatic scrolling starts.

C#
public int AutoScrollOffset { get; set; }

Methods

Checks that a candidate cell has nonnegative indices and that the requested row span fits within the Panorama's row count.

C#
protected virtual bool CanPlaceElementAtPosition(int rowIndex, int columnIndex, int colSpan, int rowSpan)
Parameters:rowIndexint

The candidate zero-based row.

columnIndexint

The candidate zero-based column.

colSpanint

The number of columns occupied by the tile.

rowSpanint

The number of rows occupied by the tile.

Returns:

bool

true when the row and column bounds pass this check; otherwise, false.

Allows drag operations only at runtime and when the owning Panorama enables tile drag-and-drop.

C#
protected override bool CanStart(object context)
Parameters:contextobject

The object that initiated the drag.

Returns:

bool

true when the owner allows dragging and the base service accepts the context.

Overrides: RadDragDropService.CanStart(object)

Converts a point in a tile group to the row and column of its grid cell.

C#
protected virtual Point GetCellAtPoint(TileGroupElement group, Point location)
Parameters:groupTileGroupElement

The group whose cell size defines the grid.

locationPoint

The point within the group's content layout.

Returns:

Point

A point containing the row in X and column in Y.

Gets the top-left coordinates of a cell in the ungrouped Panorama grid.

C#
protected PointF GetCellCoordinates(int rowIndex, int columnIndex)
Parameters:rowIndexint

The zero-based row index.

columnIndexint

The zero-based column index.

Returns:

PointF

The cell's top-left point in layout coordinates.

Gets the top-left coordinates of a cell in a tile group's grid.

C#
protected PointF GetCellCoordinates(TileGroupElement group, int rowIndex, int columnIndex)
Parameters:groupTileGroupElement

The group whose cell size defines the grid.

rowIndexint

The zero-based row index.

columnIndexint

The zero-based column index.

Returns:

PointF

The cell's top-left point in group layout coordinates.

Resolves the drop target after correcting the pointer location for the dragged-item outline offset.

C#
protected override ISupportDrop GetDropTarget(Point mousePosition, out Point resultDropLocation)
Parameters:mousePositionPoint

The pointer location used for hit testing.

resultDropLocationPoint

The drop location returned by the base hit test.

Returns:

ISupportDrop

The drop target identified by the base drag-and-drop service.

Overrides: RadDragDropService.GetDropTarget(Point, out Point)

Finds the closest candidate cell that can contain the dragged tile's row and column spans.

C#
protected virtual Point GetTargetCell(RadTileElement source, Point location)
Parameters:sourceRadTileElement

The tile being placed.

locationPoint

The pointer location in the ungrouped tile layout.

Returns:

Point

A point containing the row in X and column in Y, or (-1, -1) when no candidate can fit.

Finds the closest candidate cell around the drop point in a tile group.

C#
protected virtual Point GetTargetCell(TileGroupElement group, Point dropLocation)
Parameters:groupTileGroupElement

The group containing the candidate cells.

dropLocationPoint

The drop location in the containing control's client coordinates.

Returns:

Point

A nearby candidate row in X and column in Y; this method does not validate the candidate against the group bounds.

Returns the first tile group whose bounds intersect the proposed tile rectangle.

C#
protected virtual TileGroupElement GetTargetGroup(RectangleF tileRectangle)
Parameters:tileRectangleRectangleF

The proposed tile bounds in control coordinates.

Returns:

TileGroupElement

The first intersecting group, or null when none intersects.

Places the dragged tile in the target group and shifts overlapping tiles to make room.

C#
protected virtual void HandleGroupedDragDrop(RadDropEventArgs e)
Parameters:eRadDropEventArgs

The resolved drop target and location.

Starts edge auto-scrolling near the left or right border; otherwise, updates the hovered insertion tile.

C#
protected override void HandleMouseMove(Point mousePos)
Parameters:mousePosPoint

The pointer location in screen coordinates.

Overrides: RadDragDropService.HandleMouseMove(Point)

Places the dragged tile in the ungrouped grid and shifts overlapping tiles to make room.

C#
protected virtual void HandleUngroupedDragDrop(RadDropEventArgs e)
Parameters:eRadDropEventArgs

The resolved drop target and location.

Accepts Panorama elements and tile elements as valid drop targets.

C#
protected override bool IsDropTargetValid(ISupportDrop dropTarget)
Parameters:dropTargetISupportDrop

The potential drop target.

Returns:

bool

true for a RadPanoramaElement or RadTileElement.

Overrides: RadDragDropService.IsDropTargetValid(ISupportDrop)

Offsets the tile at the resolved insertion cell to provide drag-over feedback.

C#
protected bool OffsetHoveredTile(Point clientPoint)
Parameters:clientPointPoint

The pointer location in Panorama client coordinates.

Returns:

bool

true if the source or a target cell cannot be resolved; otherwise, false.

Applies the grouped or ungrouped tile reorder, stops auto-scrolling, and animates the dragged tile into its new position.

C#
protected override void OnPreviewDragDrop(RadDropEventArgs e)
Parameters:eRadDropEventArgs

The resolved drop target and location.

Overrides: RadDragDropService.OnPreviewDragDrop(RadDropEventArgs)

Extends the grid at its right edge when needed or scrolls the view after the edge-hover delay.

C#
protected virtual void OnScrollTimerTick()

Restores the dragged tile, stops scrolling, clears the hovered insertion offset, and zooms tiles back in.

C#
protected override void PerformStop()

Overrides: RadDragDropService.PerformStop()

Hides the dragged item, records the pointer offset within it, and zooms out the other tiles.

C#
protected override bool PrepareContext()
Returns:

bool

The result of preparing the base drag context.

Overrides: RadDragDropService.PrepareContext()