Skip to main content
A newer version of this page is available. .

TreeList.ShowFilterPopupListBox Event

Enables you to customize a particular Column’s Filter DropDown.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v18.2.dll

Declaration

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

Event Data

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

Remarks

The ShowFilterPopupListBox event fires before the Column’s Filter DropDown is displayed. Write a handler for this event to manage the items within the list. Existing items can be deleted and new ones added with custom captions and corresponding filter 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