The X and Y coords in the DragDrop events are not in control coords, they are in screen coords. So you just need to call grid.PointToClient to convert them to grid coords before you call ElementFromPoint.
Hi Mike,
Thanks for the reply, I tried adding the coords convertion before calling ElementFromPoint, but it still does not work. I tried to get different grid elements, but all of them were not recognized at runtime, didn't know why. Please help. Here is the code and the debuggint output:
private void ultraGrid1_DragDrop( object sender, DragEventArgs e )
Point pt = this.ultraGrid1.PointToClient( new Point( e.X, e.Y ) );
UIElement uiEl = this.ultraGrid1.DisplayLayout.UIElement.ElementFromPoint( pt );
UltraGridColumn col = uiEl.GetContext( typeof( UltraGridColumn ) ) as UltraGridColumn;
=====================
Debug output: