KB Article A415
Visible to All Users

How to add a new item to the grid's popup filter list

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

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.