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
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.
Beautiful! Works like a charm.
Thanks for your help.