xceedsoftware/wpftoolkit

PropertyGrid is empty despite giving extra content

TracerDS opened this issue · 1 comments

Hi. As the title suggests the PropertyGrid is totally empty.
Code:

...
<xctk:PropertyGrid x:Name="_propertyGrid" AutoGenerateProperties="False">
    <xctk:PropertyGrid.PropertyDefinitions>
        <xctk:PropertyDefinition TargetProperties="FirstName" />
        <xctk:PropertyDefinition TargetProperties="FavoriteColor" />
        <xctk:PropertyDefinition TargetProperties="PetNames" />
    </xctk:PropertyGrid.PropertyDefinitions>
</xctk:PropertyGrid>
...

image
No errors, package was included in references and added to xml.
Did I do something wrong? 🤔

Hi
You must specify a SelectedObject for the PropertyGrid to display the properties of the object.
Also, if you set the PropertyDefinitions of the PropertyGrid, only the properties FirstName, FavoriteColor and PetNames should be displayed....but the PropertyGrid's SelectedObject must contain these properties or else, nothing will be shown.

Thank you.