DayList is not shown while binding

3 posts, 0 answers
  1. Vladimir
    Vladimir avatar
    6 posts
    Member since:
    Dec 2012

    Posted 17 Feb 2014 Link to this post

    Hello I use DateSelector with MVVM and some times DayList is not shown (see attachments). It happens randomly.
    My code:
    XAML:
      <telerikInput:RadDateSelector x:Name="radDateSelector" SelectedValue="{Binding SelectedValue, Mode=TwoWay}" />

    ViewModel:
          private DateTime _SelectedValue = DateTime.Now;
            public DateTime SelectedValue
            {
                get
                {
                    return _SelectedValue;
                }
                set
                {
                    _SelectedValue = value;
                    RaisePropertyChanged("SelectedValue");
                }
            }

     private void ExecutePageLoadedCommand()
            {                     
                    SelectedValue = _CurrentDocument.date == null?DateTime.Now:(DateTime)_CurrentDocument.date;        

            }
  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 20 Feb 2014 Link to this post

    Hi Vladimir,

    Can you try putting the following portion:

    SelectedValue = _CurrentDocument.date == null?DateTime.Now:(DateTime)_CurrentDocument.date;

    In a Dispatcher.BeginInvoke and see if it helps?

    Regards,
    Deyan
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
  3. DevCraft banner
  4. Vladimir
    Vladimir avatar
    6 posts
    Member since:
    Dec 2012

    Posted 20 Feb 2014 in reply to Deyan Link to this post

    Looks like it helps me!
    Thanks a lot!
Back to Top