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
3565
DateTime Control Up/Down Key Behavior
posted

By default the date time control allows the user to use the up/down keys to increase or decease the date part values depending on where the cursor is located. I'm looking for a way to turn that feature off. I've looked through the available properties and didn't see anything that would apply. I also tried using a key mapping, but that didn't have any effect either.

Is there a way to override that increment/decrement behavior in the Date Time Control?

Parents
  • 69832
    Verified Answer
    Offline posted

    I tried this and it seems to have worked:

    foreach( Infragistics.Win.UltraWinMaskedEdit.KeyActionMapping mapping in dateTimeEditor.KeyActionMappings )
    {
        if ( mapping.KeyCode == Keys.Up || mapping.KeyCode == Keys.Down )
        {
            toRemove.Add( mapping );
        }
    }

    foreach( Infragistics.Win.UltraWinMaskedEdit.KeyActionMapping mapping in toRemove )
    {
        dateTimeEditor.KeyActionMappings.Remove( mapping );
    }

Reply Children
No Data