代码之家  ›  专栏  ›  技术社区  ›  OrPaz

wpf datagrid-由于拖放,无法使用鼠标滚动

  •  1
  • OrPaz  · 技术社区  · 15 年前

    我正在使用允许拖动其行的数据报。我的问题是,当我试图用侧边滚动条上的鼠标在网格上向下滚动时,我得到了“禁止进入”标志,这意味着“这里不允许拖放,伙计…”。如何修改拖放功能以识别这不是拖放操作,而是滚动鼠标操作?

    private new void MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                Point currentPosition = e.GetPosition(GridUC);
    
                Object selectedItem = GridUC.SelectedItem;
    
                if (selectedItem == null) return;
    
                DragDropContainerObject ddObject = new DragDropContainerObject(typeof(Actor), selectedItem);
    
                DataGridRow container = (DataGridRow)GridUC.ItemContainerGenerator.ContainerFromItem(selectedItem);
    
                if (container != null)
                {
                    DragDropEffects finalDropEffect = DragDrop.DoDragDrop(container, ddObject, DragDropEffects.Link);
                }
            }
    
        }
    
    1 回复  |  直到 14 年前
        1
  •  -1
  •   OrPaz    15 年前

    没有一个答案…

    我想我在这里做错了什么…

    不管怎样,我只是切换到使用Telerik拖放功能,忘记了这个问题…