You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: How to leave Only one filter option in FilterMenu.
3
+
description: How to leave only one filter option in the Grid FilterMenu. Applies to the TreeList too.
4
4
type: how-to
5
5
page_title: Only one filter option in FilterMenu
6
6
slug: grid-kb-only-one-filtermenu-option
7
7
position:
8
8
tags:
9
-
ticketid: 1451755
9
+
ticketid: 1451755, 1551245
10
10
res_type: kb
11
11
---
12
12
@@ -22,7 +22,7 @@ res_type: kb
22
22
23
23
24
24
## Description
25
-
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
25
+
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?
26
26
27
27
>caption Before and after results
28
28
@@ -32,66 +32,81 @@ I want simple filtering options in the filter menu - both for my uses and my bac
32
32
33
33
There are two options:
34
34
35
-
* 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.
35
+
* Use a [custom filter template]({%slug grid-templates-filter%}). It provides full flexibility over the interface and building the filter descriptor.
36
+
* 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**:
36
37
37
-
* 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.
38
+
<divclass="skip-repl"></div>
38
39
39
-
>caption Hide And/Or filter options in FilterMenu with CSS
40
+
/* UI for Blazor 3.0+ */
41
+
.k-filter-menu-container > span:nth-child(n+3) {
42
+
display: none;
43
+
}
44
+
45
+
/* UI for Blazor 2.30- */
46
+
.k-filter-menu-container > div > :nth-child(n+3) {
47
+
display: none;
48
+
}
49
+
50
+
>caption Hide And/Or filter options in the Grid/TreeList FilterMenu with CSS
40
51
41
52
````CSHTML
42
-
@* These CSS rules hide the second component wrappers *@
53
+
@* Hide the secondary filter interface with CSS *@
0 commit comments