Validation Result not shown

2 posts, 1 answers
  1. Heiko Görig
    Heiko Görig avatar
    23 posts
    Member since:
    Jun 2012

    Posted 18 Apr 2011 Link to this post

    Hello,

    I have a RadDatePicker whose SelectedValue is bound to a property of an object which implements IDataErrorInfo:

    <telerik:RadDatePicker

     

     

     

    telerik:StyleManager.Theme="Office_Black"

     

    DataContext="{Binding ReceiptDateField}"

     

    SelectedValue="{Binding SelectedDate, Mode=TwoWay, ValidatesOnDataErrors=True}"

     

     

    DateTimeWatermarkContent="" DisplayFormat="Short"

     

    Margin="296,196,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="24" Width="84"/>

    If validation failes the RadDatePicker only has a red border but no red triangle in the upper right corner. Therefore it's not possible to see the error info.
    Could you please fix this bug.

    Greetings

    Heiko

  2. Answer
    Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 22 Apr 2011 Link to this post

    Hi Heiko Görig,

    Unlike Silverligth there is no out of the box tooltip for WPF RadDatePicker. You can create easily a tooltip that will show the error using this code.

    <Grid.Resources>
        <Style TargetType="{x:Type telerik:RadDateTimePicker}">
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="true">
                    <Setter Property="ToolTip"
            Value="{Binding RelativeSource={RelativeSource Self},
                   Path=(Validation.Errors)[0].ErrorContent}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Grid.Resources>

    Hope this helps. If you have further questions please let me know.

    Kind regards,
    Boyan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top