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

ComplexType properties are always in collapsed state

Jul 3, 2012 at 11:24 AM

Hi,

I want to have ComplexType property (ExpandableObject) to be in expanded state. Is there any attribute/ or any other way to set this so that the ComplexType property is always in expanded mode. Please let me know.

Thanks,

Ram

Jul 3, 2012 at 5:07 PM

Hi,

 

If you apply the following style on your PropertyGrid, every {ExpandableObject} property will be expanded by default.  Unfortunately, it will not prevent a user from collapsing a property.

<Style x:Key="expandedPropertyGrid"
       TargetType="xctk:PropertyGrid">
   <Style.Resources>
      <Style TargetType="xctk:PropertyItem"
             BasedOn="{StaticResource {x:Type xctk:PropertyItem}}">
         <Style.Triggers>
            <DataTrigger Binding="{Binding HasChildProperties, RelativeSource={RelativeSource Self}}"
                         Value="True">
               <Setter Property="IsExpanded"
                       Value="True" />
            </DataTrigger>
         </Style.Triggers>
      </Style>
   </Style.Resources>
</Style>
Jul 5, 2012 at 4:16 AM

thanks for the quick response :)...it helped a lot