Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
# Filtering-the-property-items-of-PropertyGrid-through-attributes
Filtering the property items of PropertyGrid through attributes
# Filtering Property Items of Syncfusion WPF PropertyGrid Through Attributes
## Overview
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.

## Why Use Attribute-Based Filtering?
Attribute-based filtering is:
- **Declarative**: You define visibility directly in the model class.
- **Simple**: No need for runtime logic or event subscriptions.
- **Maintainable**: Easy to manage and understand in large codebases.

## Supported Attributes
### 1. [Browsable(false)]
This attribute hides the property from the PropertyGrid.

```C#
using System.ComponentModel;

public class Employee
{
public string Name { get; set; }

[Browsable(false)]
public string InternalCode { get; set; }

public int Age { get; set; }
}
```

### 2. [Bindable(false)]
This also hides the property from the PropertyGrid. It functions similarly to [Browsable(false)].
```C#
using System.ComponentModel;

public class Employee
{
public string Name { get; set; }

[Bindable(false)]
public string SecretKey { get; set; }
}
```