I'm dragging and dropping from one of two RadGridViews (Players and Teams) to another RadGridView (Games) which is configured as a 2-level-deep hierarchical grid. I'm trying to allow users to drag Teams to a Game row and then Players to Game rows, as below:
How can I determine which row has had (or is about to have) something dropped on it?
I've tried your example that uses
but it doesn't work, if for no other reason than that Mouse.GetPosition(null) always returns {0,0} if the drag cue is non-null.
How can I determine which target row the droppable object is over at any given time?
|
|
|
How can I determine which row has had (or is about to have) something dropped on it?
I've tried your example that uses
private void RadGridView_Drop(object sender, DragEventArgs e) {
var destinationRow = SampleGrid.GetElementsInHostCoordinates<
GridViewRow
>(Mouse.GetPosition(null)).First();
if (destinationRow != null) {
MessageBox.Show("Dropped on row:" + ((IList) SampleGrid.ItemsSource).IndexOf(destinationRow.DataContext));
}
}
but it doesn't work, if for no other reason than that Mouse.GetPosition(null) always returns {0,0} if the drag cue is non-null.
How can I determine which target row the droppable object is over at any given time?