A newer version of this page is available. Switch to the current version.

DataViewBase.GetColumnByTreeElement(DependencyObject) Method

Returns a column whose cell contains the specified tree element.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v19.1.Core.dll


public ColumnBase GetColumnByTreeElement(
    DependencyObject d
Public Function GetColumnByTreeElement(
    d As DependencyObject
) As ColumnBase


Name Type Description
d DependencyObject

The element contained within the column.


Type Description

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.


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