DataGridView.HitTestInfo是否等效于Infragistics.Win.UltraWinGrid.UltraGrid?

时间:2020-03-05 18:55:49  来源:igfitidea点击:

有谁知道Infragistics UltraGrid控件是否提供与DataGridView.HitTestInfo类似的功能?

解决方案

回答

有一个.MousePosition属性,它返回System.Drawing.Point和"获取鼠标光标在屏幕坐标中的位置",但我使用的是UltraWinGrid的较旧版本(2003)。

他们有免费的试用版下载,因此我们可以查看他们是否已将其添加到最新,最棒的:o)中。

回答

如果我们有用于UltraGrid的MouseEventHandler,则可以执行以下操作:

UltraGrid grid = (UltraGrid)sender;

UIElement element = grid.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));

然后,我们可以使用element.GetContext()根据元素的预期类型对其进行转换:

UltraGridCell cell = (UltraGridCell)element.GetContext(typeof(UltraGridCell));

回答

看一下这个。

他们不转换坐标,但使用特殊的Infragistics网格事件(MouseEnterElement)来获取元素,鼠标当前将其悬停在上面。

也许有帮助。