Skip to content

RelativeInsertPosition.TargetItemCenter in flat lists #531

Description

@DeadByte42

Hello!
It's possible to have dropInfo.InsertPosition == RelativeInsertPosition.TargetItemCenter in non hierarchical views (ListBox, ListView, DataGrid)? I want to allow to combine multiple item's data by dragging single item or multiple items onto another item, but dropInfo.InsertPosition never becomes RelativeInsertPosition.TargetItemCenter

Sample code:

void IDropTarget.DragOver(IDropInfo dropInfo)
{
    Debug.WriteLine(dropInfo.InsertPosition.ToString()); //BeforeTargetItem or AfterTargetItem or None
    if ((dropInfo.Data is Document || dropInfo.Data is List<Document>) && dropInfo.InsertPosition == RelativeInsertPosition.TargetItemCenter) //always false
        dropInfo.DropTargetAdorner = DropTargetAdorners.Highlight;
    else
        GongSolutions.Wpf.DragDrop.DragDrop.DefaultDropHandler.DragOver(dropInfo);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions