TreeList.ShowFilterPopupListBox Event
Enables you to customize a particular Column’s Filter DropDown.
Namespace: DevExpress.XtraTreeList
Assembly: DevExpress.XtraTreeList.v19.1.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.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/an-example-of-using-the-showfilterpopuplistbox-event-e3531
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);
}
}
}