I am trying to take text from a list box control and put it into a particular cell in a data Grid. I am using the following code:
private void DG_DragDrop(object sender, DragEventArgs e)
{
DataGridView.HitTestInfo theHit = DG.HitTest(e.X, e.Y);
int theCol = theHit.ColumnX;
int theRow = theHit.RowY;
MessageBox.Show(theCol.ToString() + " " + theRow.ToString());
}
By the column and row coordinates are always -1. I suspect the X and Y coming in need to be adjusted somehow, but I am not sure how or if this is the problem. Any ideas or suggestions would be appreciated...