wpftoolkit icon indicating copy to clipboard operation
wpftoolkit copied to clipboard

PropertyGrid is empty despite giving extra content

Open TracerDS opened this issue 2 years ago • 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? 🤔

TracerDS avatar Jan 23 '23 20:01 TracerDS

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.

XceedBoucherS avatar Feb 14 '23 20:02 XceedBoucherS