Skip to content

Commit a6c88bc

Browse files
authored
Merge pull request #1 from SyncfusionExamples/985360
985360: Updated ReadMe file
2 parents a5d8ff2 + c584c39 commit a6c88bc

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

README.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,41 @@
1-
# Filtering-the-property-items-of-PropertyGrid-through-attributes
2-
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+
using System.ComponentModel;
17+
18+
public class Employee
19+
{
20+
public string Name { get; set; }
21+
22+
[Browsable(false)]
23+
public string InternalCode { get; set; }
24+
25+
public int Age { get; set; }
26+
}
27+
```
28+
29+
### 2. [Bindable(false)]
30+
This also hides the property from the PropertyGrid. It functions similarly to [Browsable(false)].
31+
```C#
32+
using System.ComponentModel;
33+
34+
public class Employee
35+
{
36+
public string Name { get; set; }
37+
38+
[Bindable(false)]
39+
public string SecretKey { get; set; }
40+
}
41+
```

0 commit comments

Comments
 (0)