Page view counter
DatePicker: manually entering a date. Subscribe to this thread
Last post 11-11-2008 7:43 AM by Patrick8639. 2 replies.
Sort Posts:
11-06-2008 12:32 AM
DatePicker: manually entering a date.

Hello,

I'm in a country where the date format is JJ.MM.YYYY.

I have a DatePicker in a Silverlight application. The current date (November 6) is displayed as 06.11.2008. I now would like to enter manually a date in the DatePicker:

  • If I enter 5.11.2008, the DatePicker displays 05.11.2008: correct.
  • If I enter 5.11, the DatePicker displays 11.05.2008: incorrect, this is May 11 and should be November 5.

Patrick

Patrick8639

Loading...
Joined on 11-23-2007
Switzerland
Posts 111
11-11-2008 4:20 AM
Re: DatePicker: manually entering a date.

Hi,

you can try to format the DatePicker's displaydate.

for example:

this.pickdate.Text = this.pickdate.SelectedDate.Value.ToString("dd.MM.yyyy");
           

Amanda Wang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Amanda Wang - MSFT

Loading...
Joined on 04-30-2007
Posts 1,015
11-11-2008 7:43 AM
Re: DatePicker: manually entering a date.

Amanda,

the problem is not when the Silverlight application sets the date, it is when the user enters the date.

The application receives the SelectedDateChanged notification, but the date is not correct in the DatePicker control.

Patrick

Patrick8639

Loading...
Joined on 11-23-2007
Switzerland
Posts 111
Microsoft Communities