I am using a WinDatetimeEditor and displaying the date and time. I have a mask on the editor {LOC}dd/mm/yyyy hh:mm.
If the User sets the hours but leaves the minutes blank, when they leave the editor it reverts to the previous time entered, presumably because it sees the blank minutes as an invalid. The behaviour I want is that if the minutes are left blank then for them to be set to 00. What is the best way to acheive this ?
Thanks for your helpjohn
Sejal,
The MaskInput only controls what's shown when you're in edit mode, so you need to use the Format property with one of the .NET format strings.
-Matt
Hi,
I am using ultradatetime editor. I want display only DATE in the editor control. So I have used MaskInput for date. But when focus is lost from editor control it displays DATE and TIME both.
How to display date only in the editor control even after focus is lost from ultradatetimeeditor control. I dont want to show time in datetimeeditor. By default 12:00 AM time is displayed even though mask input format is DATE only.
Any help is appreciated.
Thanks,
sejal
John,
I get the same behavior you do. After looking into it further, I'm a bit surprised that it works without the data binding; in fact after trying it again I could reproduce it without the data binding, so I must have been doing something slightly differently (though you could reproduce it too). The reason that you're encountering this behavior is because the control cannot parse a date from the provided string with empty values, so it reverts to a valid value (controlled by the InvalidTextBehavior property). Fortunately, you could implement your own workaround as I have detailed in another thread (that I had forgotten about until now :-))
Matt,
Thanks for testing this for me. I am using version 8.3.20083.1009. I will also check that i am using the latest service release. I should have mentioned that the editor is data bound to a DateTime field in a custom object. when I do a test without the databinding then the results are OK as you have mentioned. However when the control is databound I get the problem.
Thanks John
I just tried this out and this worked correctly for me. I tried changing various values in the control, all without exiting edit mode (including changing the hours), then deleting the digits in the minutes section, and when I tabbed out of the control the minues were now "00". What version of the controls are you using? It's possible that something was fixed in the latest service release. You might also want to look at the InvalidTextBehavior property, though I didn't have to alter this in my test.