I have not watched DataGridDragDropTarget, but could not do only
protected override DataGridRow ContainerFromIndex(DataGrid itemsControl, int index)
{
var row = base.ContainerFromIndex(itemsControl, index);
if (row != null)
{
}
}
?
If this is not implemented for any reason, you can try the following:
using System.Windows.Controls.Primitives;
protected override DataGridRow ContainerFromIndex(DataGrid itemsControl, int index)
{
var rowsPresenter =
itemsControl.GetVisualDescendants()
.OfType<DataGridRowsPresenter>().FirstOrDefault();
if (rowsPresenter != null)
{
var row = rowsPresenter.Children[index];
}
}
, . , .