This project has moved and is read-only. For the latest updates, please go here.

PropertyGrid only displays property Length and no other properties

Feb 1 at 3:03 PM
Hi,

I have a PropertyGrid whose SelectedObject is set to toolBox2:
<xctk:PropertyGrid x:Name="_propertyGrid" Margin="0"
AutoGenerateProperties="True" SelectedObject="toolBox2">
</xctk:PropertyGrid>

and a TextBlock
<TextBlock x:Name="toolBox2" Text="Property Window 2"/>

When I run this all I'm getting is
Length 8

I believe that is the length of the name "toolBox2".

The question is how can I set SelectedObject to the TextBlock object?

Many thanks
Developer
Feb 1 at 4:31 PM
Hi,

You need to set a binding to your TextBlock :
  <StackPanel>
    <TextBlock x:Name="toolBox2"
               Text="Property Window 2" />

    <xctk:PropertyGrid x:Name="_propertyGrid"
                       Margin="0"
                       AutoGenerateProperties="True"
                       SelectedObject="{Binding ElementName=toolBox2}"
                       Height="500">
    </xctk:PropertyGrid>
  </StackPanel>
――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF