Hi,
if I use the XamDateTimeEditor in dropdown calendar mode and select a date using the calendar, only the date will be set and the time is left empty. Leaving the editor will present the message "The value in the editor is not valid".
How can the time be set to 00:00:00 by default or in code behind after using the calendar?AutoFillDate would be fine for time also...
And how could the above error message could be supressed and handle by my own?
If I use_EditModeValidationError-Event and set e.Handled=true, the messagebox still occurs.
best regards,
cew3
Hello,
Thank you for your post. I have been looking into it and I created a sample project for and everything seems to work as you want, by default, on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.
Hi Stefan,
thank you for the example.
Sorry, I forgot to say that I'm using a mask...To show my problem, I added a mask to the editor.
Please have a look..
Bestcew3
in your example, there's a strange behaviour:
1. Click in the editor and type 1.1.1111 and press return-> the editor shows: 01.01.1111 12:00:00
2. Click again to the editor -> the editor shows: 01.01.1111 00:00
3. Press return or edit the value and press return and the value gets cleared. In xamDateTimeEditor1_EditModeEnding the value is NULL.
??
Best,cew3
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
sorry for the delay, I didn't see your reply.
In the following video I show you the behaviour I tried to describe in my earlier post:
XamDateTimeEditor_Video.zip
I have modified the sample further, so now it works as you want.
Hope it helps you.
looks great, but....
if you type 11.11.1111 11:11:11 and press enter,
it switches to 11.11.1111 00:00:00
Time gets lost.
Hello Seth,
I have tested the sample under Windows XP and I was able to reproduce the behavior you described. This happens because the default Win XP and Win 7 culture settings are different and there is a check I made in Editor’s EditModeEnding event handler, which should be different for XP. I have modified the sample, so now it works both on XP and 7.
Hope this helps you.
Attached is a video of the behavior I am seeing with your project (unchanged). 1) I start the program; 2) place focus on the datetime control; 3) click the Calendar button; select a date (the date is returned with no time displayed); 4) tab out and the field clears; 5) tab again places me in the textbox that you added; 6) tab back into the field and the date and time is displayed (which is the behavior I am looking for in step 3 and 4). Not sure why the field is clearing in step 4.
Let me know if you see the same behavior given the steps above.
http://screencast.com/t/ULpEnY6BMT
Thanks!
Seth
I have added a TextBox to the sample I attached before and everything seems to work ok on my side. I uploaded again, so if it doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
I have a related issue. When the user invokes the calendar, I'd like the value to include a time, or at a minimum, default the time such that the user can tab off the field and not receive a validation error. That seemed to be one of the requirements of the original post.
However, in your example, if I add a textbox below the XamDateTimeEditor (so I can tab out of the XamDateTimeEditor), the field clears when the user 1) selects a date from the calendar; then 2) tabs off the field.
Here is my current xaml:
<igEditors:XamDateTimeEditor Grid.Row="5" Grid.Column="5" Margin="2" MinWidth="200" HorizontalAlignment="Stretch" NullText="" Value="{Binding DateTimeCompleted}" DropDownButtonDisplayMode="Always" Mask="{}{date} {time}" />
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.