我有一个用 C# 编写的 Winforms 应用程序。
我可以成功地将值从一个 DataGridView 拖放到同一表单上的另一个 DataGridView。
但是,我不确定如何确定 DragDrop 操作终止接收 DataGridView 中的哪个 Cell。
我尝试了以下代码 -
private void dataContactBusiness_DragDrop(object sender, DragEventArgs e)
{
var cell = dataContactBusiness.HitTest(e.X, e.Y);
//...other operations continue here
}
但是我的命中测试总是超出范围,即返回-1 的行和列索引。