RadTimePicker SelectedTime code behind

3 posts, 1 answers
  1. Sam
    Sam avatar
    27 posts
    Member since:
    Sep 2013

    Posted 11 Dec 2013 Link to this post

    Hello,

    Can anyone show me how to bind time from database field?

    I tried
    RadTimePicker1.SelectedTime = Convert.ToDateTime(dataRow["TimeDeparted"].ToString());

    Complied error:
    Error   2   Cannot implicitly convert type 'System.DateTime' to 'System.TimeSpan?'

    Thank you,
    Sam
  2. Answer
    David
    David avatar
    1 posts
    Member since:
    Apr 2012

    Posted 11 Dec 2013 Link to this post

    According to the documentation, the DbSelectedDate property "Gets or sets the date content of RadTimePicker in a database friendly way."

    Try this:
    RadTimePicker1.DbSelectedDate = dataRow["TimeDeparted"];
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sam
    Sam avatar
    27 posts
    Member since:
    Sep 2013

    Posted 12 Dec 2013 Link to this post

    it works!!

    Thanks David!
Back to Top