Hi, I am doing a drag and drop implementation from one UltraGrid to another, updating just one particular cell.
How can I find out the index of the row in the target grid the user dropped onto?
The following works great if I put a fixed index, but that of course is not the idea.
e)
{
));
//UltraGrid is configured so user can only select (and therefore dragdrop) single rows.
].Value.ToString();
dataTableTarget.Rows[INDEX OF ROW USER DROPPED ON][
] = valueString;
OK, I think I found it. You have to do it in the time-honored Windows fashion. I thought there might be a more direct way.
int dropIndex;UltraGrid dropGrid = sender as UltraGrid;UIElement uieOver = dropGrid.DisplayLayout.UIElement.ElementFromPoint(dropGrid.PointToClient(new Point(e.X, e.Y)));UltraGridRow ugrOver = uieOver.GetContext(typeof(UltraGridRow), true) as UltraGridRow;if (ugrOver != null){ dropIndex = ugrOver.Index;
It's working for me, so I guess I answered my own question.