Description:
How to add a new item to the grid's FilterPopup?
Answer:
You should handle the View's ShowFilterPopupListBox event of the GridView object. You should add the required item to the e.Combobox.Items collection and subscribe to the CloseUp event of the e.Combobox object. The event handler allows you to determine which item is clicked and implement the desired action.
C#using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid.Views.Grid;
private void gridView1_ShowFilterPopupListBox(object sender, FilterPopupListBoxEventArgs e) {
e.ComboBox.Items.Insert(0, "SomeText");
e.ComboBox.CloseUp += new CloseUpEventHandler(ComboBox_CloseUp);
}
private void ComboBox_CloseUp(object sender, CloseUpEventArgs e) {
// event test
if (e.Value.ToString() == "SomeText")
Text = e.Value.ToString();
}
See Also:
How to modify the list of available filter values displayed in the column's dropdown list
How to add an item with a complex filter condition to the column filter list