This example demonstrates how to hide or show filter row menu items for a certain column.
To do this, we assign CSS classes to:
- Filter cells using the Styles.FilterCell.CssClass property;
- Filter row menu items using the Styles.FilterRowMenuItem.CssClass property;
- Specific column's filter cell using the GridViewDataColumn.FilterCellStyle.CssClass property;
These classes will be used later to find the necessary elements:
The element's "display" style is changed based on specific conditions.[JScript]$().ready(function(){ $(".filterCell").click(function(event){var hide = $(event.currentTarget).hasClass("necessaryColumn"); ManageOptions(!hide);});});function ManageOptions(visible){var value = visible ? "list-item" : "none"; $(".frmi").each(function(){var text = $(this).text().toLowerCase();if(text.indexOf("equals")>= 0 || text.indexOf("is less than")>= 0) $(this).css("display", value);});}