I have datetimeeditors configured to display time only for a start and end time. I have code behind the form which compares start to end and if end is earlier (i.e. user enters 10:00 PM start and 2:00 AM finish) then it adds one day to the end time (so 06-14-12 2:00 AM becomes 06-15-12 2:00 AM)..
There is a drop down calendar enabled on the editor. However, if the user opens the drop down calendar and selects a different date (i.e. they meant to enter 10:00 AM and 2:00 PM so they need to reverse the action of the code behind the form) the date in the control's value does NOT change.
How can I allow the user to alter the underlying date using the calendar while only displaying and allowing direct editing of the masked time portion?
Hello ellswrth,
If I understand well your scenario, the mentioned behavior is expected (it is by design) when you are using MaksInput and FormatString to display only the TIME. If you want to achieve desired behavior maybe you could handle ultraDateTimeEditor1_BeforeDropDown() event and using MonthCalandar. Please take a look at the attached sample and video file for more details and let me know if you have any questions.
Regards
I think I have a bit of a hitch.
What I didn't share in my original post is that the DateTimeEditor is actually used as an EditorComponent attached to a DateTime column in an UltraGrid.
I'm working in VB but have translated the sample you posted. If I create a sample form exactly as per your sample it works fine.
But on the UltraGrid, it appears the BeforeDropDown event for the DateTimeEditor doesn't fire - is that possible?
Is there another event I can hook to do this?
I'm afraid I ran out of time to try this and went with a more pragmatic solution.
I let the users flip the masks on the two DateTimeEditors between {LOC} hh:mm tt and {LOC} mm/dd/yy hh:mm tt - this meets the requirement.
I'll go back and look at the last alternative proposed in the next quiet moment.
Thanks!
Thanks for your feedback. If you have any further questions, please do not hesitate to write us
Hi,
I am using UltraGrid in my application.
That grid contains only one column called value.
Depeneidng on some criteria , in run time i am setting editor component of the column value.
When i m setting it to DateTime havin mask input, format string evey thing set as
FormatString =
"dd/MM/yyyy hh:mm:ss",
MaskInput =
"dd/mm/yyyy hh:mm:ss".
When i am running the application, second section is not appearing in the grid cell also its not allowing me to enter more than 12 number i.e. if i try to enter 13 or more than that it's not allowing me to do that.
Please let me know in case some thing specific needs to be done for getting both the above mentioned point done.
Request you to reply at the earliest.
Hello rranjan1471,
I`m not familiar with your scenario, but I try to reproduce it in a small sample. Could you please take a look at the attached sample for more details and let me know if you think that I didn`t reproduce your case. Please feel free to modify this sample and revert it back to me. I`ll be glad to research it for you.
If you have any questions do not hesitate to write me
Here is the sample