General

Coordinator
May 10, 2009 at 4:34 PM

Any questions here.

Dec 14, 2009 at 12:40 PM

Hi,

Thanks for your control.

I want to set a date to the selecteddate property. But it is not setting correctly and showng incorrect date?

Please Suggest me a solutions.

My code here:

 

<font size="2">

dateSelector.SelectedDate =

</font>

DateTime.Now;

Above code added in the constructor in given sample.

 

 

Coordinator
Dec 15, 2009 at 1:59 PM
Edited Dec 15, 2009 at 2:00 PM

Hi, anandakumar. Can you give me more detailed error description?

As for me, the assignment works in both VisualStudio 2008 and 2010 Beta2. I used the next XAML:

<vwcmp:DateSelector x:Name="dateSelectorTest" LocaleName="en-US" SelectedDate="01/01/2000" />

and such a code in the Window constructor:

dateSelectorTest.SelectedDate =

DateTime.Now;

Dec 16, 2009 at 7:45 AM

Hi,

Thanks for your reply.

It's working when i set the date inside the loaded event.  I don't know why it is not working in constructor.

moreover I'm not able to set null to the selected date, means i want to avoid default selection of some other date. Because i use this control to select Date of birth. In this case user may or may not select date of birth.

Please suggest me what should i do?

 

Thanks,

Anand 

 

Coordinator
Dec 16, 2009 at 2:43 PM

Hi.

1. If it is possible, show me your constructor code. I will try to reproduce bug.

2. NULL value for the SelectedDate is now not supported, because control can show only a valid date. I will think how to realize this kind of functionality. Today you can use, for example, the CheckBox ("Is Date of birth available...") and change DateSelector's IsEnabled property.