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
1960
Unexpected behavior of MinDate
posted

I have an UltraDeteTimeEditor with MinDate = 01/01/2000 12:30 AM, MaxDate = 01/01/2000 11:59 PM and Value = 1/1/2000 12:31:00 AM. The spin button is set to visible. I'm attaching a test project with that configuration.

Try the following tests:

1) Run the app, select the minutes an click the down spin button. The control allows me to set the time to a value lower than 12:30 AM. I think that's a bug. The minimum should be 12:30 AM. When the control contains that value the down spin button should be disabled.

2) Stop the app, set the SpininCrement to 1 minute. Run the app, select minutes and click the down spin button. The value changes from 12:31 AM to 1:00 AM and the down spin button is disabled. That's not the expected behavior. I expect the same results described on test #1.

I'm I missing something?

Thanks,

Oscar.

UltraDateTimeEditorNumberSectionSelectionTest.zip
Parents
  • 69832
    Verified Answer
    Offline posted

    I believe the time component of those properties is not applicable, i.e., the property names are MinDate/MaxDate as opposed to MinDateTime/MaxDateTime. If you like you can submit a feature request for a way to restrict the time range as well.

    The Infragistics.Win.UltraWinMaskedEdit.NumberSection class exposes MinValue and MaxValue properties. A "section" is typically the part of a mask that lies between the literals, for example an HourSection or MinuteSection. These are settable properties, so you can impose a minimum/maximum on a per-section basis. The DateTimeEditor exposes a Sections collection (by virtue or deriving from EditorWithMask), so you can access them from that collection. I suppose in your case you would do something like case each one to the desired type (HourSection, MinuteSection, etc.) and if the cast is non-null, set the MinValue/MaxValue accordingly.

Reply Children