Returns the
UltraListViewUIElement which represents this
UltraListView control in the user interface.
The following code sample demonstrates how to use the UltraListView control's UIElement property to locate descendant UIElements. In this example, the UIElement class' 'ElementFromPoint' method is used to hit test for an UltraListViewColumnHeaderUIElement; if one is found, the value of its 'Column' property is returned:
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinListView
Private Function ColumnFromPoint(ByVal listView As UltraListView, ByVal point As Point) As UltraListViewColumnBase
If listView Is Nothing Or listView.UIElement Is Nothing Then Return Nothing
' If there is an UltraListViewSubItem at the specified point,
' return a reference to its Column property
Dim subItem As UltraListViewSubItem = listView.SubItemFromPoint(point)
If Not subItem Is Nothing Then Return subItem.Column
' Try to find an UltraListViewColumnHeaderUIElement if we do,
' return a reference to its Column property
Dim elementAtPoint As UIElement = listView.UIElement.ElementFromPoint(point)
Dim headerElement As UltraListViewColumnHeaderUIElement = Nothing
While (Not elementAtPoint Is Nothing)
If elementAtPoint.GetType() Is GetType(UltraListViewColumnHeaderUIElement) Then
headerElement = CType(elementAtPoint, UltraListViewColumnHeaderUIElement)
Return headerElement.Column
End If
elementAtPoint = elementAtPoint.Parent
End While
Return Nothing
End Function
using Infragistics.Win;
using Infragistics.Win.UltraWinListView;
using System.Diagnostics;
private UltraListViewColumnBase ColumnFromPoint( UltraListView listView, Point point )
{
if ( listView == null || listView.UIElement == null )
return null;
// If there is an UltraListViewSubItem at the specified point,
// return a reference to its Column property
UltraListViewSubItem subItem = listView.SubItemFromPoint( point );
if ( subItem != null )
return subItem.Column;
// Try to find an UltraListViewColumnHeaderUIElement; if we do,
// return a reference to its Column property
UIElement elementAtPoint = listView.UIElement.ElementFromPoint( point );
UltraListViewColumnHeaderUIElement headerElement = null;
while ( elementAtPoint != null )
{
headerElement = elementAtPoint as UltraListViewColumnHeaderUIElement;
if ( headerElement != null )
return headerElement.Column;
elementAtPoint = elementAtPoint.Parent;
}
return null;
}
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2