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
DatePicker
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"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:UI="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
Title="Window1" Height="300" Width="300">
<StackPanel Orientation="Vertical">
<UI:RadDatePicker/>
<TextBox/>
</StackPanel>
</Window>

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.

Regards

Chris

1 Answer, 1 is accepted

Sort by
0
Miroslav
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,
Miroslav
the Telerik team

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