DataViewBase.GetColumnByTreeElement(DependencyObject) Method

Returns a column whose cell contains the specified tree element.

Namespace: DevExpress.Xpf.Grid

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

Declaration

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

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