This is a migrated thread and some comments may be shown as answers.

String to RadDatePicker

2 Answers 196 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
STEPHEN
Top achievements
Rank 1
STEPHEN asked on 04 Oct 2010, 11:34 PM
I am carrying over a session variable from a raddatepicker on another page.  How to I convert it from the string below to be the default value of the raddatepicker on the new page?

Dim strPayDate As String = CType(Session.Item("PayDate"), String)
        If Not Page.IsPostBack Then
            'convert string to date
            Dim dt As DateTime
            dt = Convert.ToDateTime(strPayDate)
            RadPayDate1 = dt
            

Error is "Date cannot be converted to Teleric.WebUI.RadDatePicker. Thank you.

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 05 Oct 2010, 06:13 AM
Hello Stephen,


You need to use the SelectedDate property of RadDatePicker as shown below.

C#:
RadPayDate1.SelectedDate = dt1.Date

http://www.telerik.com/help/aspnet-ajax/calendar_radcalendarselection.html


-Shinu.
0
STEPHEN
Top achievements
Rank 1
answered on 05 Oct 2010, 01:09 PM
Thanks, Really appreciate the help.
Tags
Calendar
Asked by
STEPHEN
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
STEPHEN
Top achievements
Rank 1
Share this question
or