Back to Devexpress

TreeList.ShowFilterPopupCheckedListBox Event

windowsforms-devexpress-dot-xtratreelist-dot-treelist-c62af20a.md

latest4.2 KB
Original Source

TreeList.ShowFilterPopupCheckedListBox Event

Fires before a pop-up filter menu is displayed. Allows you to customize the value checklist.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
[DXCategory("Behavior")]
public event FilterPopupCheckedListBoxEventHandler ShowFilterPopupCheckedListBox
vb
<DXCategory("Behavior")>
Public Event ShowFilterPopupCheckedListBox As FilterPopupCheckedListBoxEventHandler

Event Data

The ShowFilterPopupCheckedListBox event's data class is DevExpress.XtraTreeList.FilterPopupCheckedListBoxEventArgs.

Remarks

If the TreeListColumn.OptionsFilter.FilterPopupMode property is set to CheckedList , the pop-up filter menu contains a value checklist. You can handle the ShowFilterPopupCheckedListBox event to customize the checklist (for instance, disable or hide particular values).

Example

The following example shows how to remove the “(Select All)” item from the Department Column’s Filter DropDown.

csharp
using System;
using System.Windows.Forms;
using DevExpress.XtraTreeList;

namespace ShowFilterPopupCheckedListBox_example
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.table1TableAdapter.Fill(this.treelistdbDataSet.Table1);
        }

        private void treeList1_ShowFilterPopupCheckedListBox(object sender, FilterPopupCheckedListBoxEventArgs e)
        {
            if (e.Column.FieldName != "Department") return;
            // disable "(Select All)" item
            e.CheckedComboBox.SelectAllItemVisible = false;
        }
    }
}
vb
Imports Microsoft.VisualBasic
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraTreeList

Namespace ShowFilterPopupCheckedListBox_example
    Partial Public Class Form1
        Inherits Form
        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
            Me.table1TableAdapter.Fill(Me.treelistdbDataSet.Table1)
        End Sub

        Private Sub treeList1_ShowFilterPopupCheckedListBox(ByVal sender As Object, ByVal e As FilterPopupCheckedListBoxEventArgs) Handles treeList1.ShowFilterPopupCheckedListBox
            If e.Column.FieldName <> "Department" Then
                Return
            End If
            ' disable "(Select All)" item
            e.CheckedComboBox.SelectAllItemVisible = False
        End Sub
    End Class
End Namespace

See Also

ShowFilterPopupListBox

Filtering

Classic Style

TreeList Class

TreeList Members

DevExpress.XtraTreeList Namespace