Xceed Toolkit Plus for WPF v4.6 Documentation
AutoGenerateProperties Property
Example 


Xceed.Wpf.Toolkit Assembly > Xceed.Wpf.Toolkit.PropertyGrid Namespace > PropertyGrid Class : AutoGenerateProperties Property
Gets or sets a value indicating whether the PropertyGrid will generate all properties for a given object.
Syntax
'Declaration
 
Public Property AutoGenerateProperties As Boolean
'Usage
 
Dim instance As PropertyGrid
Dim value As Boolean
 
instance.AutoGenerateProperties = value
 
value = instance.AutoGenerateProperties
public bool AutoGenerateProperties {get; set;}

Property Value

true if the PropertyGrid will generate all properties for a given object; false otherwise. By default, true.

Remarks

If this property is set to false, you must add PropertyDefinition instances to PropertyDefinitions for each of the properties you want generated for display.

Note: This collection is not used when properties are provided using PropertiesSource or Properties.

Example
The following shows how to create a PropertyGrid that doesn't not automatically generate all the properties for a given object by setting the AutoGenerateProperties property to False and providing a collection of PropertyDefinitions of the properties you would like to show.
<xctk:PropertyGrid x:Name="_propertyGrid" Width="450" Margin="10"
                         AutoGenerateProperties="False">
    <!-- Only the following properties will be displayed in the PropertyGrid -->
    <xctk:PropertyGrid.PropertyDefinitions>
        <xctk:PropertyDefinition Name="FirstName" />
        <xctk:PropertyDefinition Name="FavoriteColor" />
        <xctk:PropertyDefinition Name="PetNames" />
    </xctk:PropertyGrid.PropertyDefinitions>
</xctk:PropertyGrid>
Requirements

Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

PropertyGrid Class
PropertyGrid Members