views:

405

answers:

3

I've run into a problem that I'm certain others have hit and solved. In several places in my application I have 'Grids'. More specifically Infragistic's UltraWinGrid's - but the idea is that, inside of a grid press 'TAB' moves you to the next cell in the grid. When you are in the last cell of a row, pressing tab will move you to the next row. If you are in the last cell of the last row, pressing tab will move you to a new row.

The problem is that the form consists of more than just that one grid. At some point - you want to tab 'out' of that grid and move to the next control.

I figured it would make sense to use a keyboard shortcut to provide this alternative 'Tab' behavior....but it seems like all of the options are taken.

Shift+tab = tab backwards Ctrl+tab = tab between windows within the application (and we have MDI children and what not, so we don't want to change this) Alt+Tab = Windows shortcut to change applications Windows Key + tab = Same as above with a new GUI.

In grids that don't have an unlimited number of rows - I can make a regular tab move them out of the grid. But in this case, there is no end of the grid.

Does anyone have any suggestions/tips for how to solve this? I really want to be able to let our users navigate the application, completely, without touching the mouse.

+1  A: 

What do you mean by an "infinite" number of rows... does tabbing in this grid when you come to the end, just keep creating new empty rows.

You could test to see if they were in the last cell of the last new row when they press the tab-key and if so, .Focus() the next control on the winForm. Alternatively, you could just trap the tab-key completely as a control navigation key, and let them use the arrow keys to navigate within the Grid.

Eoin Campbell
"If you are in the last cell of the last row, pressing tab will move you to a new row."So, I don't think I can test to see if they are in the last cell of the last new row - because, in that situation, pressing tab should create a new, new row and move them to the first cell in that row.I like the idea of using the arrow keys to navigate the cells of a grid - but If you type "Cait' instead of cat and wanted to arrow back one and hit the backspace, you'd be unable to do so. I'm not sure if that's a deal breaker or not. Interesting suggestion.
Rob P.
+1  A: 

What do you think your chances are of having your users know this keyboard shortcut?

Maybe Alt + Shift + Tab (it works well in my hands).

However, you shouldn't make this kind of decision without testing it with users. This will give you two outputs, A) You can see if this is the kind of thing that your users would actually do, and B) you might be able to teach your user base.

AdamC
Alt-Shift-Tab of course also switches among application windows in MS Windows, just in reverse order of Alt-Tab. Were you thinking Alt-Ctrl-Tab?
Michael Zuschlag
+1  A: 

If you have one grid set among form-type controls (e.g., text boxes, combo boxes), you can use Esc to switch out of the grid to one of the form controls, either to the first control or to the last one to have focus.

If you have multiple grids (or multiple panes), Esc can put the focus on the current grid/pane as a whole. Tab and Shift-Tab moves focus among grids/panes. Other keys provide short cuts to manipulate the panes (e.g., open, close, resize, column select). Pressing Esc while focus is on a whole pane/grid puts focus back into the grid/pane.

In either case, I’d still use Ctrl-Tab and Shift-Ctrl-Tab to move in and out of grids or among grids, as well as among windows in a MDI. Essentially, treat grids (or panes) within each window as a “window in a window.” This makes the most sense if the windows are related in the same way that the grids within a window are related (e.g., all show data objects that are associated with each other). If the user is in a grid, then Ctrl-Tab moves out of the grid but remains in the window (or moves to the next grid/pane in that window). Once the user runs out of places to go within a window, Ctrl-Tab moves to the next window (or to the first pane/grid within that window).

Michael Zuschlag
I wish I could accept everyone's answer - as there isn't a 'correct' answer in my mind. I've ended up implementing this solution with escape key. With any luck, the users won't hate it.
Rob P.