DateTimePicker control not displaying properly

2 posts, 0 answers
  1. Tony
    Tony avatar
    111 posts
    Member since:
    May 2011

    Posted 06 Sep 2011 Link to this post

    I’m using the RadDateTimePicker control is a WPF application and it’s behaving very oddly.


    Here’s the XAML for the control:

      

    <UserControl x:Class="CarSystem.CustomControls.HotListEdit" 
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                  xmlns:cs="clr-namespace:CarSystem.CustomControls" 
                  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
                  xmlns:Telerik_Windows_Controls_Chromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls" 
                  mc:Ignorable="d" 
                  DataContext="{Binding HotListEntry, Mode=TwoWay, RelativeSource={RelativeSource Self}}" 
                  Height="600" 
                  Width="1122"> 
                                       . . .

        <telerik:RadDateTimePicker CurrentDateTimeText="{Binding Path=EndDate, Mode=TwoWay}"

                                   FontSize="18" 

                                  FontWeight="Bold" 

                                  Margin="1" 

                                  x:Name="EndDateBox" 

                                   Template="{DynamicResource RadDateTimePickerControlTemplate1}" 

                                  VerticalAlignment="Top" />

                                        . . .

    </UserControl>


    As you can see, I’ve bound the CurrentDateTimeText property of the control to a DateTime property of an object that is bound to the UserControl’s
    DataContext property.

     

    When I run this program and load an object into the HotListEntry property of the UserControl, the value of the EndDate DateTime property is displayed above the actual date time control, not in it.  Further, if you switch away from the application and come back to it, the extra box containing the EndDate disappears.  

     

    I have removed the Template attribute from the XAML for the control and that did not make any difference to the position of the date time on screen.  The interesting thing is that if you use the picker, the extra date-time appears after you set the date to its new value, AND the date you pick appears inside the control.


    I’m using the Q2 2011 build of the library.  Is this issue some kind of template problem or is it a bug?  Will you be fixing this soon?  We need this working ASAP.

     

    Thank you

    Tony

  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 07 Sep 2011 Link to this post

    Hello Tony,

    Actually this behavior of CurrentDateTimeText property is by design - it is changed while the user is typing a text in the textbox and also provides some kind of suggestion about the entered date.

    I'm not sure what exactly is your requirement, may be you need to modify the watermark content of the control or bind the SelectedDate? Could you please give us more details about the needed approach?

    Kind regards,
    Yana
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top