Set Date on DateSelector Control from C# Code-Behind file

3 posts, 1 answers
  1. Jwan
    Jwan avatar
    4 posts
    Member since:
    May 2012

    Posted 16 May 2013 Link to this post

    Hello

    When my WP8 application starts, I want the date selector to show a certain date that is calculated based on today's date.

    How can I do this? When I reference my control from the C# code behind file, and attempt to .setValue(), the parameters asked by the method are DependencyProperty and ObjectValue !! I was expecting the DateSelector to accept a Date or DateTime value !

    Can someone please tell me how I can set the date on my DateSelector UI XAML Control from the code behind file?

    Thank You.
  2. Jwan
    Jwan avatar
    4 posts
    Member since:
    May 2012

    Posted 16 May 2013 Link to this post

    By the way, I have checked the documentation, it says nothing about setting the value, only getting it!
  3. DevCraft banner
  4. Answer
    Deyan
    Admin
    Deyan avatar
    2040 posts

    Posted 17 May 2013 Link to this post

    Hi Jwan,

    Setting the date on the Date Selector is done in the following way:

    this.radDateSelector.SelectedValue = DateTime.Now;


    Kind regards,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top