Error boxes remain when collapsing categories

Grids for WPF Forum

Posted 13 years ago by Rick Edwards - UK
Version: 11.1.0545
Avatar
Hi all,

I've been implementing the classic red box error decorators to our property grid and noticed an interesting issue when collapsing a category in so far as the red boxes remain visible even though the editors disappear when the category is collapsed by toggling an expander. This leads to the error border or box simply floating in the middle of the property grid.

Any ideas as to how to fix this, I'm assuming it's an issue with our error templates not being bound to some expander event maybe? I've some images I can email if it helps to visualise the problem.

Thanks for any advice.

Rick

Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Rick,

This is a known issue with WPF. The workaround is explained here. But basically, you need to do something like:
<ControlTemplate>
    <ControlTemplate.Resources>
        <BooleanToVisibilityConverter x:Key="converter" />
    </ControlTemplate.Resources>
    <Border BorderThickness="1" BorderBrush="Red"
            Visibility="{Binding ElementName=placeholder, Path=AdornedElement.IsVisible, Converter={StaticResource converter}}">
        <AdornedElementPlaceholder x:Name="placeholder" />
    </Border>
</ControlTemplate>


Actipro Software Support

The latest build of this product (v24.1.2) was released 10 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.