We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I hide the "Custom" option in the filterbar dropdown?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: April 30, 2011 |
Last Revised Date: February 12, 2016

To achieve this, implement a custom filter bar cell that derives the cell model/cell renderer from the GridTableFilterBarCellModel/GridTableFilterBarCellRenderer.

The GridTableFilterBarCellModel.FillWithChoices method is overridden to remove the string Custom from the list.



The GridTableFilterBarCellModel.Select method is rewritten with the Select_withoutcustom method that specifies the index for the selected item. You can pass the index for the Custom selected item as 0.



The GridTableFilterBarCellModel.ListBoxMouseUp() method is overridden to invoke the Select_withoutcustom method instead of the Select method.



A new CellType is created by adding the instance of the derived GridTableFilterBarCellModel class into the GridGroupingControl’s cellmodels.



After applying the properties, the Grid is displayed as follows.

Figure 1: Hiding the custom option

Sample Links

CS: Hiding custom_option

VB: Hiding custom_option

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment
maurizio ziraldo
Jun 11, 2015
This solution has a problem when you have some hidden columns. Add this line of code to your sample in Form1.cs: this.gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Name"); then run the sample and try to filter by WorkingBranch: you will see that the filter is applied to the wrong column City. To avoid this you can change this line: string _columnName = _grid.TableDescriptor.Columns[_filed].Name; with string _columnName = _grid.TableDescriptor.VisibleColumns[_filed].Name; in ListBoxMouseUp event of custom Cell Model. Reply
Venkatesh Sundaram [Syncfusion]
Jun 12, 2015
Hi Maurizio , Thanks for your valuable suggestions. We have modified the sample as per your suggestions and the sample link is updated in the kb article. please let us know if you have any concerns. Thanks and Regards, Venkat. Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon