I am having the functionality of Drag and Drop.
Dragging an Item from UltraExplorerBar and dropping on to a UltraGrid. I am able to achieve this functionality by implementing DragDropManager.IDragSource, DragDropManager.IDropTarget interfaces for Drag and drop respectively. I am also using DragDropManager class from Infragistics Samples.
But I am not able to achieve the following functionality –
Thanks,
Madhav
Never mind. And for others' benefit:
// find the grid row we are overPoint lClientPoint = lUltraGrid.PointToClient(new Point(e.X, e.Y));UIElement lUIElement = mUltraGrid.DisplayLayout.UIElement.ElementFromPoint(lClientPoint);UltraGridRow lUltraGridRow = (UltraGridRow)lUIElement.GetContext(typeof(UltraGridRow));
How do I do this inside of the grid's DragOver event? I get my drag object but I never find any row that I am over. I can't find an example of a grid dragover in any samples and the documentation is totally worthless - some robo documenter just barfed out the class into a help file with zero semantics as to any member usage.
Thanks a lot...this works fine.....
Assuming you have implemented the IDropTarget interface for the UltraGrid, in the OnDropTargetNotify method implementation for the DragOver case, add the following code:
UltraGrid grid = sender as UltraGrid; Point point = grid.PointToClient(Control.MousePosition); UIElement controlElement = grid.DisplayLayout.UIElement; UIElement elementAtPoint = controlElement != null ? controlElement.ElementFromPoint( point ) : null; UltraGridRow rowAtPoint = elementAtPoint != null ? elementAtPoint.GetContext( typeof(UltraGridRow) ) as UltraGridRow; if ( rowAtPoint != null ) { }
This will give you a reference to the row at the current cursor position, if there is one.