WPF DataGrid - Can't Use Mouse To Scroll Because Of Drag Drop
I am using a datagrid that is 开发者_如何学Pythonallowing to drag its rows. My problem is that when i try to scroll down on my grid using the mouse on the side scroller, i get the 'no enterance' sign that means that "drag and drop is not allowed here, dude...". How can i modify my drag and drop function to recognize that this is not a drag and drop action, but a scroll mouse action?
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);
}
}
}
Not a single answer...
I guess im doing something really wrong here...
Anyhow, i just switched to use Telerik drag and drop functionality and forgot from this problem...
精彩评论