Skip to main content

DataViewBase.GetColumnByTreeElement(DependencyObject) Method

Returns a column whose cell contains the specified tree element.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public ColumnBase GetColumnByTreeElement(
    DependencyObject d
)

Parameters

Name Type Description
d DependencyObject

The element contained within the column.

Returns

Type Description
ColumnBase

A ColumnBase descendant that specifies the column whose cell contains the specified tree element. null (Nothing in Visual Basic), if the column was not found.

Remarks

private void grid_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) {
    GridColumn column = grid.View.GetColumnByTreeElement(e.OriginalSource as DependencyObject);
    if (column != null) {
        // ...
    }
}

To learn more, see Accessing and Identifying Columns.

See Also