void dataGridView1_DragDrop(object sender, DragEventArgs e)
{
object data = e.Data.GetData(typeof(string));
MessageBox.Show(e.X + " " + e.Y + " " + dataGridView1.HitTest(e.X, e.Y).RowIndex.ToString());
if (dataGridView1.HitTest(e.X, e.Y).Type == DataGridViewHitTestType.Cell)
{
MessageBox.Show("!");
}
}
If I try to drag an item to a datagridview with the above test code, I receive the correct data from the data.ToString()
ok but i cannot target a row or cell.
The RowIndex.ToString()
returns "-1", and my if statement returns false so never enters if coded block.
What is wrong with my code?