Back to Devexpress

DataViewBase.GetRowElementByTreeElement(DependencyObject) Method

wpf-devexpress-dot-xpf-dot-grid-dot-dataviewbase-dot-getrowelementbytreeelement-x28-system-dot-windows-dot-dependencyobject-x29.md

latest2.0 KB
Original Source

DataViewBase.GetRowElementByTreeElement(DependencyObject) Method

Returns the row that contains the specified tree element.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public FrameworkElement GetRowElementByTreeElement(
    DependencyObject d
)
vb
Public Function GetRowElementByTreeElement(
    d As DependencyObject
) As FrameworkElement

Parameters

NameTypeDescription
dDependencyObject

The tree element contained within the row.

|

Returns

TypeDescription
FrameworkElement

A FrameworkElement descendant that is the row containing the specified tree element. null ( Nothing in Visual Basic), if the row was not found.

|

Remarks

csharp
private void grid_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) {
    FrameworkElement rowElement = 
        grid.View.GetRowElementByTreeElement(e.OriginalSource as DependencyObject);
    double rowHeight;
    if(rowElement != null)
        rowHeight = ((GridRow)rowElement).ActualHeight;
}

See Also

DataViewBase Class

DataViewBase Members

DevExpress.Xpf.Grid Namespace