Rank: Newbie Groups: Member
Joined: 1/18/2009 Posts: 2
|
When i am parsing DatePicker.SelectedDates.Add(future.datetime) with are future date is it showing today date, however when im using a date i the past to the datepicker is working properly.
best regards
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
This is normal if you also set SelectedDate/SelectedDates elsewhere (typically through .aspx). In this case the SelectedDates will have multiple values. Multiple SelectedDate value is only used by Calendar, not by DatePicker. DatePicker uses the earliest date in SelectedDates. So if you already set SelectedDate/SelectedDates to have the current date elsewhere and then call SelectedDates.Add to provide more value, if that new value is earlier than what you already have, that value will be displayed; if it is later, then the original value will be displayed.
To avoid this problem, use DatePicker.SelectedDate = future.DateTime. Do not use SelectedDate.Add.
Hope this helps.
Thanks!
|