Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
UltraDateTimeEditor - Roll AM/PM in time mode?
posted

I'm using the UltraDateTimeEditor as a time editor

(MaskInput="{LOC}hh:mm tt"; FormatString="hh:mm tt"; SpinButtonDisplayStyle=Always;)

and would like the AM/PM to change when I click the spin buttons (for the hour portion and go from 11->12 and 12->11. (I see this behaviour using the standard WinForms DateTimePicker control and would like to get the UDTE control to do the same.)

 

I initially tried to use the EditorSpinButtonClick() event and just manually track when the value changes from 11 to 12 but I am not receiving that event when I click on the spin buttons (this seems like a bug). Is there some flag I need to set in order to receive this event?

Anyone know how to get the AM/PM to roll?

 

Thanks,

- Josh

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Josh,

        The standard spin button that you see on the DateTimeEditor is not an EditorButton. This button is built-in to the control. The EditorButtons are something else. These are buttons that you add to the ButtonsRight or ButtonsLeft collection of the control.

        So if the standard button doesn't spin the AM/PM sign, then what you can do is hide it. I beleive there's a property called SpinButtonLocation which you can set the None.

        Then you could add a SpinEditorButton to the ButtonsRight collection on the control and handle the EditorSpinButtonClick event to control the behavior however you want. 

Reply Children