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

TreeList.ShowFilterPopupListBox Event

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

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v24.2.dll

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

#Declaration

[DXCategory("Behavior")]
public event FilterPopupListBoxEventHandler ShowFilterPopupListBox

#Event Data

The ShowFilterPopupListBox event's data class is DevExpress.XtraTreeList.FilterPopupListBoxEventArgs.

#Remarks

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

#Example

The following example shows how to remove default “(Blanks)” and “(Non blanks) items from the Name Column’s Filter DropDown.

Example ShowFilterPopupListBox default   Example ShowFilterPopupListBox edited

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

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

        private void treeList1_ShowFilterPopupListBox(object sender, FilterPopupListBoxEventArgs e)
        {
            if (e.Column.FieldName == "Name")
            {
                //Removes "(Blanks)"
                e.ComboBox.Items.RemoveAt(0);
                //Removes "(Non blanks)"
                e.ComboBox.Items.RemoveAt(0);
            }
        }

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

        }
    }
}
See Also