Skip to main content

Microsoft Silverlight

DatePicker: manually entering a date.RSS Feed

(0)

Patrick8639
Patrick8639

Member

Member

575 points

150 Posts

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

Amanda Wang - MSFT
Amanda W...

All-Star

All-Star

17241 points

1,466 Posts

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.

Patrick8639
Patrick8639

Member

Member

575 points

150 Posts

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

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities