【发布时间】: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