【问题标题】:WPF DataGrid - Can't Use Mouse To Scroll Because Of Drag DropWPF DataGrid - 由于拖放而无法使用鼠标滚动
【发布时间】:2011-12-16 04:07:35
【问题描述】:

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

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);
            }
        }

    }

【问题讨论】:

    标签: wpf wpf-controls wpfdatagrid prism


    【解决方案1】:

    没有一个答案...

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

    无论如何,我只是切换到使用 Telerik 拖放功能并忘记了这个问题......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多