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

DatePicker calendar unresponsive after setting date server side

1 Answer 63 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 08 Oct 2013, 03:20 PM
Basically, when I try to set the date through something like this:

RadDatePicker1.SelectedDate = DateTime.ParseExact(dateToConvert, "yyyyMMdd", CultureInfo.InvariantCulture);

the calendar popup button stops working. Any ideas?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 09 Oct 2013, 04:27 AM
Hi J,

Please try the following code snippet to set the SelectedDate of RadDatePicker using ParseExact.

C#:
protected void RadDatePicker1_Load(object sender, EventArgs e)
{
    string dateString ,format;
    dateString = "06/15/2008";
    format = "d";
    CultureInfo provider = CultureInfo.InvariantCulture;
    DateTime result = DateTime.ParseExact(dateString, format, provider);
    RadDatePicker1.SelectedDate = result;
 
}
Note: Please follow this documentation.

Alternate Method to set SelectedDate:
C#:
RadDatePicker1.SelectedDate = DateTime.Today;

Hope this will help you
Thanks,
Shinu


Tags
Calendar
Asked by
J
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or