Editors and tooltips

Editors for WPF Forum

Posted 14 years ago by Rick Edwards - UK
Version: 10.1.0522

we're using the Actipro editors with the Property Grid and I'm trying to set up the display of errors usign tooltips for editors such as the DoublePropertyEditor. Now I can set a style on a textbox like so

    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Validation.ErrorTemplate">
                    <Border BorderBrush="Red" BorderThickness="1">
                        <AdornedElementPlaceholder />
            <Trigger Property="Validation.HasError" Value="true">
                <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors).CurrentItem, Converter={StaticResource ErrorContentConverter}}"/>

and this works fine for textboxes but does not display the tooltip for the DoublePropertyEditor. If I change the above target type to point to the DoublePropertyEditor then it throws an error stating that tooltip is not a property of the editor.

Is there a general way to apply the above error styling to all Actipro editors used in the property grid?


Rick Edwards

Comments (1)

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

The DoublePropertyEditor isn't a control, it's just a mapping that ties properties of type Double or Double? to the DoubleEditBox. So you'd need to create an implicit Style for "editors:DoubleEditBox".

There isn't a general or generic way to apply the same ErrorTemplate to all the controls in the PropertyGrid, or any WPF control for that matter. You might be able to override it globally using code-behind though, but you couldn't apply the Style trigger globally. To change the ErrorTemplate globally, you'd need to override the metadata for Valudation.ErrorTemplateProperty for the Control type, using a custom DataTemplate as the default value.

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.