Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Move rows in a grid with combobox program?
Message
From
09/12/2008 09:47:45
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Move rows in a grid with combobox program?
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01366188
Message ID:
01366188
Views:
77
Hi all,

Is there a way to move down a row in a grid when the current control is a combo box? Usually I could use something like KEYBOARD "{DNARROW}" PLAIN but this does not work on a combobox. I have tried a bunch of key combinations (Ctrl_DnArrow etc) and nothing seems to be able to move down a row once you are in a combo.

The reason this comes up is that users have a grid that they do data entry in and when they get to the last cell in the row, instead of cycling back around to the first column, they want it to go down a row and then back to the first col. When I first programmed this, the first column had a textbox and so I could just do this in the keypress event of the last column:
* if user pressed <Enter> or <Tab> go to the next line down
IF nShiftAltCtrl = 0 AND ( nKeyCode = 13 OR nKeyCode = 9 )

    KEYBOARD "{DNARROW}" PLAIN

   * and set focus to the first column
  THIS.PARENT.PARENT.Column1.SetFocus()

ENDIF
Now with the combobox in Col 1, focus seems to get set to that first and then the down arrow gets used by the combobox to move choices in it.

Or maybe there is a different way to do this totally. I had thought of stuffing multiple keystrokes in to get back to the start of the grid (DnArrow and then Shift+Tab x 11) but since the grid is 12 cols wide, it seemed a funny way to do it. Or maybe I set t focus to the 2nd col and then back up a cell (but I would rather do the above).

Thanks,
Albert
Next
Reply
Map
View

Click here to load this message in the networking platform