Back to Devexpress

TreeListView.CustomFilterPopupList Event

wpf-devexpress-dot-xpf-dot-grid-dot-treelistview-84d77473.md

latest4.0 KB
Original Source

TreeListView.CustomFilterPopupList Event

Allows you to filter values displayed in a column Drop-down Filter.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public event CustomColumnFilterListEventHandler CustomFilterPopupList
vb
Public Event CustomFilterPopupList As CustomColumnFilterListEventHandler

Event Data

The CustomFilterPopupList event's data class is CustomColumnFilterListEventArgs. The following properties provide information specific to this event:

PropertyDescription
ColumnGets or sets a column which owns the processed cell.
NodeGets or sets a node which contains the processed cell.
VisibleGets or sets whether the processed value is displayed within a column’s Drop-down Filter.

Remarks

The TreeListView raises the CustomFilterPopupList event before a column Drop-down Filter is populated with unique values. This event is raised for each value displayed in the processed column and allows you to hide values from the list.

The CustomColumnFilterListEventArgs.Node and CustomColumnFilterListEventArgs.Column properties specify the processed node and column. To obtain the processed value, use the TreeListView.GetNodeValue method. To hide a value from the list, set the CustomColumnFilterListEventArgs.Visible property to false.

The following code sample demonstrates how to hide root node values from the filter list:

xaml
<dxg:TreeListControl.View>
    <dxg:TreeListView TreeDerivationMode="ChildNodesSelector" 
                      ChildNodesPath="Tasks"
                      FilteringMode="ParentBranch"
                      CustomFilterPopupList="TreeListView_CustomFilterPopupList"/>
</dxg:TreeListControl.View>
csharp
void TreeListView_CustomFilterPopupList(object sender, DevExpress.Xpf.Grid.TreeList.CustomColumnFilterListEventArgs e) {
    e.Visible = e.Node.Level != 0;
}
vb
Private Sub TreeListView_CustomFilterPopupList(ByVal sender As Object, ByVal e As DevExpress.Xpf.Grid.TreeList.CustomColumnFilterListEventArgs)
    e.Visible = e.Node.Level <> 0
End Sub

Handle the CustomUniqueValues event to populate the filter list with custom values.

See Also

Custom Drop-down Filter

TreeListView Class

TreeListView Members

DevExpress.Xpf.Grid Namespace