Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Modifying Numeric Pad Decimal Key Behavior

Modifying Numeric Pad Decimal Key Behavior

Scheduled Pinned Locked Moved C#
helpcsharpperformancetutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Skynyrd
    wrote on last edited by
    #1

    Hi all, I've got a bit of a problem here, and maybe the solution is obvious but I cant seem to find it. We are developing a client app that reads a whole lot of numerical data through keyboard input. The main input control is NET's base library DataGrid. This application will have to be localized in different countries which means that the decimal separator might be a comma or a period depending where the application is running. The problem is that .NET's DataGrid will always recognize the numeric keypad decimal key as a period (unlike for example MS Excel, where it will always recongize it as the decimal separator no matter what the current culture info is). This isn't too much of a problem in countries where the decimal separator is a period, but in countries where its a comma, the decimal key in the numericpad is useless, thus lowering the user's keyboard input performance. Is there any way that I can intercept the keyboard event and change the input to a generic CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator string/char? Obviously DataGrid's key events dont work because they dont capture the events when editing a cell and I cant seem to hook up any event to a datagridcell. I've been looking at windows messages and I'm not sure if the same thing is happening...messages in the messageloop of the currentcell are not going through the datagrid control ??? PD Changing OS Culture Info is not a valid solution. any help would be appreciated, and sorry for any spelling mistakes, I'm not english spoken thanks.

    A 1 Reply Last reply
    0
    • S Skynyrd

      Hi all, I've got a bit of a problem here, and maybe the solution is obvious but I cant seem to find it. We are developing a client app that reads a whole lot of numerical data through keyboard input. The main input control is NET's base library DataGrid. This application will have to be localized in different countries which means that the decimal separator might be a comma or a period depending where the application is running. The problem is that .NET's DataGrid will always recognize the numeric keypad decimal key as a period (unlike for example MS Excel, where it will always recongize it as the decimal separator no matter what the current culture info is). This isn't too much of a problem in countries where the decimal separator is a period, but in countries where its a comma, the decimal key in the numericpad is useless, thus lowering the user's keyboard input performance. Is there any way that I can intercept the keyboard event and change the input to a generic CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator string/char? Obviously DataGrid's key events dont work because they dont capture the events when editing a cell and I cant seem to hook up any event to a datagridcell. I've been looking at windows messages and I'm not sure if the same thing is happening...messages in the messageloop of the currentcell are not going through the datagrid control ??? PD Changing OS Culture Info is not a valid solution. any help would be appreciated, and sorry for any spelling mistakes, I'm not english spoken thanks.

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      bump...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups