Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DataViewBase.GetColumnByTreeElement(DependencyObject) Method

Returns a column whose cell contains the specified tree element.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.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