void PerformDropToView(DragDropManagerBase sourceManager, Point pt, MoveRowsDelegate setreorderDelegate, MoveRowsDelegate moveToGroupDelegate, MoveRowsDelegate addRowsDelegate) {
			UIElement element = GetVisibleHitTestElement(pt);
			TreeListViewHitInfo hitInfo = GetHitInfo(element) as TreeListViewHitInfo;
			int insertRowHandle = hitInfo.RowHandle;
			TreeListNode insertNode = TreeListView.GetNodeByRowHandle(insertRowHandle);
			TreeListDragOverEventArgs e = RaiseDragOverEvent(hitInfo, sourceManager);
			if(e.Handled ? !e.AllowDrop : !e.AllowDrop || InternalBanDrop(insertRowHandle, insertNode, sourceManager)) {
				ClearDragInfo(sourceManager);
				sourceManager.SetDragInfoVisibility(e.ShowDragInfo);
				SetDropMarkerVisibility(e.ShowDropMarker);
				return;
			}
			if(hitInfo.HitTest == TreeListViewHitTest.DataArea) {
				if(sourceManager.DraggingRows.Count > 0 && GetDataAreaElement(element) != null) {
					addRowsDelegate(sourceManager, insertRowHandle, element);
				} else {
					ClearDragInfo(sourceManager);
				}
				return;
			}
			if(insertRowHandle == GridControl.InvalidRowHandle) {
				ClearDragInfo(sourceManager);
				return;
			}
			setreorderDelegate(sourceManager, insertRowHandle, element);
		}
		void PerformDropToView(DragDropManagerBase sourceManager, Point pt, MoveRowsDelegate reorderDelegate, MoveRowsDelegate moveToGroupDelegate, MoveRowsDelegate addRowsDelegate) {
			UIElement element = GetVisibleHitTestElement(pt);
			TableViewHitInfo hitInfo = TableView.CalcHitInfo(element);
			int insertRowHandle = hitInfo.RowHandle;
			if(BanDrop(insertRowHandle, hitInfo, sourceManager)) {
				ClearDragInfo(sourceManager);
				return;
			}
			if(GridControl.IsGroupRowHandle(insertRowHandle)) {
				moveToGroupDelegate(sourceManager, insertRowHandle, element);
				return;
			}
			if(IsSortedButNotGrouped() || hitInfo.HitTest == TableViewHitTest.DataArea) {
				if(sourceManager.DraggingRows.Count > 0 && GetDataAreaElement(element) != null && !ReferenceEquals(sourceManager, this)) {
					addRowsDelegate(sourceManager, insertRowHandle, element);
				} else {
					ClearDragInfo(sourceManager);
				}
				return;
			}
			if(insertRowHandle == GridControl.InvalidRowHandle) {
				ClearDragInfo(sourceManager);
				return;
			}
			if(GridControl.GroupCount > 0) {
				int groupRowHandle = GridControl.GetParentRowHandle(insertRowHandle);
				moveToGroupDelegate(sourceManager, groupRowHandle, element);
			} else {
				reorderDelegate(sourceManager, insertRowHandle, element);
			}
		}
Example #3
0
        protected void PerformDropToView(DragDropManagerBase sourceManager, TableViewHitInfo hitInfo, Point pt, MoveRowsDelegate reorderDelegate, Func <bool, MoveRowsDelegate> groupDelegateExtractor, MoveRowsDelegate addRowsDelegate)
        {
            int insertRowHandle = hitInfo.RowHandle;
            var grid            = GetSourceGrid();

            if (this.GridControl.IsGroupRowHandle(insertRowHandle))
            {
                groupDelegateExtractor(true)(sourceManager, insertRowHandle, HitElement);
                return;
            }
            if (IsSortedButNotGrouped(grid) || hitInfo.HitTest == TableViewHitTest.DataArea)
            {
                if (sourceManager.DraggingRows.Count > 0 && GetDataAreaElement(HitElement) != null /* && !ReferenceEquals(sourceManager, this)*/)
                {
                    addRowsDelegate(sourceManager, insertRowHandle, HitElement);
                }
                else
                {
                    ClearDragInfo(sourceManager);
                }

                return;
            }
            if (insertRowHandle == GridControl.InvalidRowHandle || insertRowHandle == GridControl.AutoFilterRowHandle || insertRowHandle == GridControl.NewItemRowHandle)
            {
                ClearDragInfo(sourceManager);
                return;
            }
            if (this.GridControl.GroupCount > 0)
            {
                int groupRowHandle = this.GridControl.GetParentRowHandle(insertRowHandle);
                if (ShouldReorderGroup(grid))
                {
                    if (!IsSameGroup(sourceManager, GetGroupInfos(groupRowHandle), HitElement))
                    {
                        groupDelegateExtractor(false)(sourceManager, groupRowHandle, HitElement);
                    }
                    reorderDelegate(sourceManager, insertRowHandle, HitElement);
                }
                else
                {
                    groupDelegateExtractor(true)(sourceManager, groupRowHandle, HitElement);
                }
            }
            else
            {
                reorderDelegate(sourceManager, insertRowHandle, HitElement);
            }
        }