New to Telerik UI for WPFStart a free 30-day trial

Get Old and New Parent of a Task after Reordering via Drag and Drop

Updated on Sep 15, 2025

Environment

Product Version2019.1 318
ProductRadGanttView for WPF

Description

How to acquire the old and new parent of a task after reorder via drag and drop.

Solution

For the purpose you can define a custom GanttDragDropBehavior and override its Drop method as follows:

C#
  	protected override void Drop(SchedulingDragDropState state)
  	{
		var task = state.DraggedItem as GanttTask;
		var item = this.Gantt.ExpandCollapseService.HierarchicalCollectionAdapter.GetItemWrapperByItemKey(task);
		var previousParent = item.Parent;
		base.Drop(state);
		var newItem = this.Gantt.ExpandCollapseService.HierarchicalCollectionAdapter.GetItemWrapperByItemKey(task);
		var newParent = newItem.Parent;
  	}

See Also