Stecya
Stecya

Reputation: 23266

DevExpress Filter Editor : DropdownList

When constructing filter in Filter Editor, can i provide list of possible values ?

Example :

enter image description here

Can I have here ComboBox with possible values instead of TextEdit ?

Upvotes: 2

Views: 6104

Answers (1)

DevExpress Team
DevExpress Team

Reputation: 11376

Yes, it is possible. You should handle the FilterEditorCreated event of the GridView as shown below:

private void gridView1_FilterEditorCreated(object sender, DevExpress.XtraGrid.Views.Base.FilterControlEventArgs e) {
    DevExpress.XtraEditors.Repository.RepositoryItemComboBox combo = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox();
    combo.Items.Add("Item 1");
    combo.Items.Add("Item 2");
    e.FilterControl.FilterColumns["ProductName"].SetColumnEditor(combo);
}

Upvotes: 4

Related Questions