BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Me.CustomGridControl1.Model.Options.WrapCellBehavior = GridWrapCellBehavior.NextControlInForm
Now if your grid is directly on a form, this is all you have to do. If your grid is on a panel, or groupbox or tabpage or some other container, then you will also have to handle the WrapCellNextControlInForm event and actually move the focus to where you want it in your container. Here is a sample that might help. The sample has 2 grids, the one on the left is parented to the form, and the one of the right is on a panel. Out of the box, just setting the NextControlInForm value, makes the grid on the left behave as expected, allowing you to tab from button1 to the grid to button2. But the grid on the panel does not behave as expected. There you tab from button3 to the grid to button 1, passing over button 4 which is the next button on the panel.
The way to handle this problem is to catch the WrapCellNextControlInForm event, and set the focus the way you want it done depending upon the parent container being used. In the sample, there is commented code in the handler that will move the focus on the panel (the way you might expect). The reason the grid architect opted to expose an event to handle this is that he did not want to try to add code to handle arbitary containers. Instead, the default behavior should handle a form as a parent, but if you have something else, then you will have to use the event.
//in formload this.gridControl1.ContextMenu = this.contextMenu1; this.gridControl1.ControlAdded += new ControlEventHandler(grid_ControlAdded); //the handler private void grid_ControlAdded(object sender, ControlEventArgs e) { e.Control.ContextMenu = this.contextMenu1; }This will just display the this.contextMenu1 every where in the grid whether or not a current cell control is has focus or not. You do not have to handle right-clicks or anything, and the menu key will work. But if you are handling the right clicks to show position dependent menus, then you could do the sample thing, and handle the menu's Popup event, clearing the MenuItems there an dreadding the ones you want to see at this particular popup. Exactly how this works your depend on how you want to determine wher ethe location is. Th edefault behavior is to display the menu where the mouseposition is. If you do not want to change what you are doing now (probably not using the ContextMenu property), then you can catch this keystroke in CurrentCellKeyDown as in this code:
private void gridControl1_CurrentCellKeyDown(object sender, KeyEventArgs e) { if(e.KeyCode == Keys.Apps) { Console.WriteLine("menukey); } }If the current cell is actively being edited, then this event is not hit as the key goes to the cell control. If you need to catch this case as weel, then instead of handling the CurrentCellKeyDown event, I think you would have to derive the GridControl and override ProcessDialogKey, catching the Keys.Apps there for both cases.
this.gridControl1.WantTabKey = false;
This should make teh grid ignore teh tab key.