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
40
Change DateTime spinner increments
posted

 Hi,

Just wondering if how to change the spinner increments for a DateTime column in a WinGrid? At the moment it defaults to a single minute - I'd like it to increment 15 minutes at a time - and not just cycle the minutes but increment the hours as required. Is there a way I can capture the spinner button press and manually alter the value?

 Thanks in advance,

Scott 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

     Hi Scott,

        The spinning is context sensitive. Do it depends on the location of the cursor. If the cursor is in the minute section, it spins a minute at a time. If it's in the hour section, it spins an hour at a time.

        There's no way to change the incremement when using the built-in spinner. But you can do what you want using an editor. Put an UltraDataTimeEditor on the form with your grid. Don't set SpinButtonDisplayStyle. Use the ButtonsRight collection and add a SpinEditorButton. 

        Set the grid column's EditorContorl to the UltraDateTimeEditor.

        Unlike the built-in spin button, this button does nothing by default. You have to code it using by handling the EditorSpinButtonClick event of the UltraDateTimeEditor. Use e.Context in this event to determine the Cell of the grid which is being spun.

         

Children