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
Filtering the property items of PropertyGrid through attributes
1
+
# Filtering Property Items of Syncfusion WPF PropertyGrid Through Attributes
2
+
## Overview
3
+
The Syncfusion WPF PropertyGrid control allows developers to filter or hide specific properties using standard .NET attributes. This approach is ideal when you want to statically control which properties are visible in the PropertyGrid without writing additional event-handling logic.
4
+
5
+
## Why Use Attribute-Based Filtering?
6
+
Attribute-based filtering is:
7
+
-**Declarative**: You define visibility directly in the model class.
8
+
-**Simple**: No need for runtime logic or event subscriptions.
9
+
-**Maintainable**: Easy to manage and understand in large codebases.
10
+
11
+
## Supported Attributes
12
+
### 1. [Browsable(false)]
13
+
This attribute hides the property from the PropertyGrid.
14
+
15
+
```C#
16
+
usingSystem.ComponentModel;
17
+
18
+
publicclassEmployee
19
+
{
20
+
publicstringName { get; set; }
21
+
22
+
[Browsable(false)]
23
+
publicstringInternalCode { get; set; }
24
+
25
+
publicintAge { get; set; }
26
+
}
27
+
```
28
+
29
+
### 2. [Bindable(false)]
30
+
This also hides the property from the PropertyGrid. It functions similarly to [Browsable(false)].
0 commit comments