RadDatePicker tooltip on validation error from viewmodel

2 posts, 0 answers
  1. Andy
    Andy avatar
    3 posts
    Member since:
    Nov 2010

    Posted 23 Dec 2010 Link to this post

    Hi,

    I'm trying to set the tooltip on the RadDatePicker when I get a validation error from my viewmodel.


    <Trigger Property="Validation.HasError"Value="True">
    <Setter Property="FrameworkElement.ToolTip"
                                     Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors).CurrentItem, Converter={StaticResource edenValidationErrorToolTipConverter}}"
                                        TargetName="PART_DateTimeInput" />
                            </Trigger>


    No matter  what I try, I can't seem to update the tooltip.

    Thanks,
    Andy

  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 28 Dec 2010 Link to this post

    Hi Andy,

    In case your RadDatePickers are data bound, you have to defined the binding expression to throw an exception in case of invalid input date:

    <telerik:RadDatePicker>
                <telerik:RadDatePicker.SelectedDate>
                    <Binding Path="SelectedDate" ValidatesOnDataErrors="True"
                            UpdateSourceTrigger="PropertyChanged">
                        <Binding.ValidationRules>
                            <ExceptionValidationRule />
                      <DataErrorValidationRule />
                        </Binding.ValidationRules>
                    </Binding>
                </telerik:RadDatePicker.SelectedDate>
            </telerik:RadDatePicker>


    All the best,
    Kaloyan
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top