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

Tabbing away from RadDatePicker causes exception in WPF core code

1 Answer 59 Views
This is a migrated thread and some comments may be shown as answers.
Chris Smith
Top achievements
Rank 1
Chris Smith asked on 17 Sep 2008, 02:36 PM
We are currently using a RadDatePicker in an input form and we have discovered a problem with tabbing - when we tab away from the RadDatePicker, we get an exception:

'ContentControl' TargetType does not match type of element 'Control'.

The stack trace shows that the exception is being thrown deep within WPF.

This is very simple to reproduce:

<Window x:Class="RadDatePickerTabBug.Window1"
Title="Window1" Height="300" Width="300">
<StackPanel Orientation="Vertical">

Running this will reproduce the problem!

Can you help us?  The simplicity of reproducing this shows that it's not anything we're doing with styling, retemplating, etc. on the RadDatePicker.



1 Answer, 1 is accepted

Sort by
Telerik team
answered on 18 Sep 2008, 08:27 AM
Hello Chris,

Thanks for the feedback!

The problem arises from a bug whereby a FocusVisualStyle setter targets ContentControl rather than Control. (This is the FocusVisualStyle of the toggle button of the DatePicker).

I am attaching a project in which the template for the DatePicker is fixed. If you are using a custom style, please set this focus visual style to "{x:Null}", also the IsTabStop property of the TextBox in the template should be set to true.

In the project I have put the XAML in a separate file which is referenced in the Application Resources. With the next release this will be fixed, then you will be able to remove the file and its reference.

Thanks for bringing this to our attention! Your Telerik points have been updated.

Kind regards,
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Asked by
Chris Smith
Top achievements
Rank 1
Answers by
Telerik team
Share this question