This is a migrated thread and some comments may be shown as answers.

RadDatePicker tooltip on validation error from viewmodel

1 Answer 200 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 23 Dec 2010, 07:12 PM
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

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 28 Dec 2010, 09:36 AM
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
Tags
DatePicker
Asked by
Andy
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or