Tabbing away from RadDatePicker causes exception in WPF core code

2 posts, 0 answers
  1. Chris Smith
    Chris Smith avatar
    14 posts
    Member since:
    Aug 2008

    Posted 17 Sep 2008 Link to this post

    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.


  2. Miroslav
    Miroslav avatar
    922 posts

    Posted 18 Sep 2008 Link to this post

    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.
Back to Top