diff --git a/knowledge-base/grid-kb-only-one-filtermenu-option.md b/knowledge-base/grid-kb-only-one-filtermenu-option.md index 7f09f9f9ae..6c161b2a93 100644 --- a/knowledge-base/grid-kb-only-one-filtermenu-option.md +++ b/knowledge-base/grid-kb-only-one-filtermenu-option.md @@ -1,12 +1,12 @@ --- title: Only one filter option in FilterMenu -description: How to leave Only one filter option in FilterMenu. +description: How to leave only one filter option in the Grid FilterMenu. Applies to the TreeList too. type: how-to page_title: Only one filter option in FilterMenu slug: grid-kb-only-one-filtermenu-option position: tags: -ticketid: 1451755 +ticketid: 1451755, 1551245 res_type: kb --- @@ -22,7 +22,7 @@ res_type: kb ## Description -I want simple filtering options in the filter menu - both for my uses and my backend. How do I remove the extra conditions so it behaves like the filter row and does not have extra and/or operators +I want simple filtering options in the Grid filter menu - both for my uses and my backend. How do I remove the extra conditions so it behaves like the filter row and does not have extra and/or operators? >caption Before and after results @@ -32,66 +32,81 @@ I want simple filtering options in the filter menu - both for my uses and my bac There are two options: -* A [custom filter template]({%slug grid-templates-filter%}) provides full flexibility, including on building the filter descriptor. This is the approach we recommend for such a scenario. +* Use a [custom filter template]({%slug grid-templates-filter%}). It provides full flexibility over the interface and building the filter descriptor. +* Use custom CSS to [override the theme]({%slug themes-override%}) and hide the elements that provide the and/or secondary conditions. The example below demonstrates this approach. Note that **the required CSS is different for different UI for Blazor versions**: -* You can use CSS to hide the elements that provide the and/or secondary conditions. An example of this is provided below. Note that the CSS rules used by the grid rendering may change and that these rules will also target all the grids on the page. +
->caption Hide And/Or filter options in FilterMenu with CSS + /* UI for Blazor 3.0+ */ + .k-filter-menu-container > span:nth-child(n+3) { + display: none; + } + + /* UI for Blazor 2.30- */ + .k-filter-menu-container > div > :nth-child(n+3) { + display: none; + } + +>caption Hide And/Or filter options in the Grid/TreeList FilterMenu with CSS ````CSHTML -@* These CSS rules hide the second component wrappers *@ +@* Hide the secondary filter interface with CSS *@ + +