Hi, I was trying to drag and drop from a ultralistview control to a ultragrid. While dropping an item I want to identify the Row or Cell at the point of dropping. If any one knows how to do it, please help me. Thanks, Joby
Hi,
I was trying to drag and drop from a ultralistview control to a ultragrid. While dropping an item I want to identify the Row or Cell at the point of dropping. If any one knows how to do it, please help me.
Thanks,
Joby
/// <summary>/// Returns the UltraGridRow at the spcified point, or null if there is none./// </summary>/// <param name="grid">The UltraGrid</param>/// <param name="point">The location, relative to the grid's coordinate system.</param>/// <param name="cell">[out] A reference to the cell at the specified point, or null if there is none.</param>static private UltraGridRow RowFromPoint( UltraGrid grid, Point point, out UltraGridCell cell ){ cell = null;
UIElement controlElement = grid != null ? grid.DisplayLayout.UIElement : null; if ( controlElement == null ) return null;
UIElement element = controlElement.ElementFromPoint( point ); UltraGridRow row = element != null ? element.GetContext( typeof(UltraGridRow) ) as UltraGridRow : null; cell = element != null ? element.GetContext( typeof(UltraGridCell) ) as UltraGridCell : null;
return row; }