TreeList.ShowFilterPopupDate Event

Allows you to customize a column’s dropdown calendar before it is displayed.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v21.1.dll


public event FilterPopupDateEventHandler ShowFilterPopupDate

Event Data

The ShowFilterPopupDate event's data class is DevExpress.XtraTreeList.FilterPopupDateEventArgs.


If the OptionsColumnFilter.FilterPopupMode property is set to Date, the Column’s Filter DropDown is displayed as a calendar. In this mode, you can handle the ShowFilterPopupDate event to customize the dropdown (for instance, disable or hide particlar items). This event is raised each time before the filter dropdown is displayed.


The following example shows how to add a new item to the Hired Column’s Filter DropDown.

Example ShowFilterPopupDate

View Example

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

namespace ShowFilterPopupDate
    public partial class Form1 : Form
        public Form1()

        private void Form1_Load(object sender, EventArgs e)

        private void treeList1_ShowFilterPopupDate(object sender, FilterPopupDateEventArgs e)
            if (e.Column.FieldName != "Hired") return;
            DateTime firstDayOfFirstYear = new DateTime(1982, 1, 1);
            DateTime lastDayOfFirstYear = new DateTime(1982, 12, 31);

            CriteriaOperator firstDay = new BinaryOperator(
                e.Column.FieldName, firstDayOfFirstYear, BinaryOperatorType.GreaterOrEqual);
            CriteriaOperator lastDay = new BinaryOperator(
                e.Column.FieldName, lastDayOfFirstYear, BinaryOperatorType.Less);
            CriteriaOperator crit = new GroupOperator(GroupOperatorType.And, firstDay, lastDay);

            e.List.Add(new DevExpress.XtraEditors.FilterDateElement("Year of Foundation", "", crit));

See Also