How to change filter editor appearance in Devexpress gridview to combobox

Devexpress Gridview is one the components which probably is being used frequently in any form dealing with data. The Gridview comes with a filter editor which let users to query results based on a condition, however if number of columns is too many it is hard to traverse the menu to find desired column. Look at the following screen:

filter editor

If for instance the number of columns grows to 100, believe me it is hard to scroll through the menu and find a column. To rectify this issue you can set ‘UseMenuForOperandsAndOperators’ to false and the menu converts to a combobox with search capability. refer to following figure:

filter editor

You need to handle it during ‘FilterEditorCreated’ event as bellow:

Private Sub GridView1_FilterEditorCreated(sender As Object, e As DevExpress.XtraGrid.Views.Base.FilterControlEventArgs) Handles GridView1.FilterEditorCreated
        'change the filter editor visual style
        e.FilterControl.UseMenuForOperandsAndOperators = False
    End Sub

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *