Keeping the cursor on the same column in a row of a grid using the keypress event RRS feed

  • Question

  • I want to stay on one specific column text of a grid using the up and down arrows without it going to the next row. How do I keep it right there?
    • Changed type Don Tan Tuesday, December 8, 2009 5:06 PM Changing to Question
    Thursday, December 3, 2009 3:47 PM


  • Processing has to be done in the keypress method of the 'textbox' (or whatever control you are using in the column object of the grid).  Trap the key that you wish to process yourself (UpArrow and DnArrow inkey() values are 5 and 24 respectively).  Once you've done what you want remember to issue a 'nodefault' (stops keypress from having it's default behavior).

      lparameters nKeyCode, nShiftAltCtrl
      if nKeyCode = 5 or nKeyCode = 24
            * do special processing here

    • Marked as answer by Larry_Nuñez Tuesday, December 8, 2009 5:17 PM
    Saturday, December 5, 2009 8:07 PM