RadDatePicker Update issue

2 posts, 0 answers
  1. Eric
    Eric avatar
    2 posts
    Member since:
    Jan 2013

    Posted 25 Apr 2013 Link to this post

    There seems to be a bug with the raddatepicker, when a bound property is updated, the value displayed is not updated to the correct value. I'm trying to prevent the user from entering a future date, and I can step through the property and field is setting it correctly, also, after the change is raised, it's returning the new date set in code behind, but the UI still displays the typed in date.  This code works as expected with the built in WPF datepicker. (ie the UI updates to the correct date (DateTime.Now) if a future date is entered).

    <telerik:RadDatePicker SelectedDate="{Binding Path=ApplicationDate, Mode=TwoWay}" DisplayDateEnd="{x:Static sys:DateTime.Now}"/>


    The property for the bound value is defined as
    public DateTime? ApplicationDate
            {
                get { return Loan.ApplicationDt; }
                set
                {
                    if (value > DateTime.Now.Date)
                        Loan.ApplicationDt = DateTime.Now.Date;
                    else
                        Loan.ApplicationDt = value;
                    RaisePropertyChanged("ApplicationDate");
                }
            }
  2. Eric
    Eric avatar
    2 posts
    Member since:
    Jan 2013

    Posted 25 Apr 2013 Link to this post

    I found the answer, the SelectedDate property doesn't work, but using SelectedValue as the binding instead does the trick...ie changed the xaml to

    <telerik:RadDatePicker SelectedValue="{Binding Path=ApplicationDate, Mode=TwoWay}" DisplayDateEnd="{x:Static sys:DateTime.Now}"/>

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