alexa
menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class PropertyGridAttribute

    Represents a class which is used to customize the properties in PropertyGrid.

    Inheritance
    System.Object
    PropertyGridAttribute
    Namespace: Syncfusion.Windows.PropertyGrid
    Assembly: Syncfusion.PropertyGrid.Wpf.dll
    Syntax
    public class PropertyGridAttribute : Attribute

    Constructors

    PropertyGridAttribute()

    Initializes a new instance of the PropertyGridAttribute class with the NestedPropertyDisplay mode and property type.

    Declaration
    public PropertyGridAttribute()
    Examples

    Apply Show for properties of type System.DateTime.

     
    [PropertyGridAttribue(NestedPropertyDisplayMode = NestedPropertyDisplayMode.Show, PropertyType= typeof (DateTime))]
    public class Person
    {
       public Bank Bank { get; set; }
       public DateTime DateOfBirth { get; set; }
       public DateTime LastLogedIn { get; set; }
    } 

    Properties

    NestedPropertyDisplayMode

    Gets or sets the NestedPropertyDisplayMode value that is used for the property.

    Declaration
    public NestedPropertyDisplayMode NestedPropertyDisplayMode { get; set; }
    Property Value
    Type
    NestedPropertyDisplayMode
    Examples

    Apply Show for StartDate property.

     
    public class Person
    {
       public Bank Bank { get; set; }
    

    [PropertyGridAttribue(NestedPropertyDisplayMode = NestedPropertyDisplayMode.Show, PropertyName = "StartDate")] or [PropertyGridAttribue(NestedPropertyDisplayMode = NestedPropertyDisplayMode.Show)] public DateTime StartDate { get; set; } }

    PropertyName

    Gets or sets the property name to which NestedPropertyDisplayMode will be applied.

    Declaration
    public string PropertyName { get; set; }
    Property Value
    Type
    System.String
    Examples

    Apply Show for StartDate and Bank property.

    [PropertyGridAttribue(NestedPropertyDisplayMode = NestedPropertyDisplayMode.Show, PropertyName = "StartDate, Bank")]
    public class Person
    {
       public Bank Bank { get; set; }
       public DateTime StartDate { get; set; }
    }

    PropertyType

    Gets or sets the property type to which NestedPropertyDisplayMode will be applied.

    Declaration
    public Type PropertyType { get; set; }
    Property Value
    Type
    System.Type
    Examples

    Apply Show for properties of type System.DateTime.

     
    [PropertyGridAttribue(NestedPropertyDisplayMode = NestedPropertyDisplayMode.Show, PropertyType = typeof(DateTime))]       
    public class Person
    {
       public Bank Bank { get; set; }
       public DateTime DateOfBirth { get; set; }
       public DateTime LastLoggedIn { get; set; }
    }
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved