Hello everybody!
For a project I built a custom DataGridView column which contains NumericUpDown controls. It is implemented similar to the suggestion from Microsoft
The column works fine under Windows XP. It accepts the entered digits and decimal separator. Under Windows Vista I have the odd problem that the control only accepts the decimal separator entered by the numeric keypad but not from the keyboard main block.
I have to add that I work with German (Switzerland) culture settings under Windows Vista and the German (Switzerland) keyboard layout is activated. The decimal separator in Switzerland is .
Someone has an idea for the reason and maybe a solution? Thank you very much!
Michael
Edit: I found the solution to my problem.
To clarify the situation a little bit more. The NumericUpDown control I use implements IDataGridViewEditingControl and inherits from NumericUpDown. Because of IDataGridViewEditingControl I implement the method EditingControlWantsInputKey. And in the implementation of this method I found my mistake or what went wrong.
In the method I inspected the entered keys and decided if the control had to handle it. But for the decimal separator I only expected Keys.Decimal. In my special (wrong) case the key could not be matched. What was missing was to look for Keys.OemPeriod too. And that was the fix.