diff --git a/README.md b/README.md index 3517e00..5065b41 100644 --- a/README.md +++ b/README.md @@ -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; } +} +```