We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Strange problem with shortcut key being eaten

Hi, we are having a strange problem where our shortcut key (F2) is not working after we reset and refresh the grid. I was wondering if you might have any suggestions on how to track this issue down. The users can change the input of a row to yearly, monthly or quarterly by using a context menu. Before they change any rows, they are able to use the F2 key to duplicate values along the row and it works fine. After we change any row input to a different covered range, the F2 key is ignored. If some numbers are typed in a cell, then the F2 key is pressed, it somehow just loses the focus of the cell (I put a console message in the gridCurrentCellControlLostFocus handler). But if we break there, the stack is empty. What could be triggering the cell to lose focus? If we then try to do a context menu (not do anything just show the menu), the F2 key will work again and we do not lose focus when clicking the F2 key ... Ideas? The only thing we do between the F2 key working and it not working when we change the row covered cell is to do these calls gridControl.ResetVolatileData(); gridControl.Refresh(); do we need to set something else? what could the context menu be doing that enables the f2? Thanks, Corinne

4 Replies

AD Administrator Syncfusion Team June 1, 2004 12:49 PM UTC

The grid uses F2 to toggle between a cell in and out of edit mode. This might be interfering with your use of F2. If you want to avoid this default behavior, try deriving the grid, and overriding OnKeyDown. In your override, if the key is F2, don''t call teh baseclass.


CM Corinne Muir June 1, 2004 03:59 PM UTC

Thanks for the quick response. We will change it to another shortcut. Is there a list somewhere that shows what shortcuts the grid implements? Is F5 used? Thanks, Corinne


CM Corinne Muir June 1, 2004 06:59 PM UTC

I replaced the shortcut F2 with F5 and I am still experiencing the same problems - after the redisplay of the grid to include the covered ranges, I click in a cell, start typing and then try to click the shortcut key (F5). It does not go to the handler and it goes into the lost focus handler. Ideas? Thanks, Corinne


AD Administrator Syncfusion Team June 2, 2004 08:14 AM UTC

Maybe the problem has to do with the state of the currentcell. If the current cell is actively being edited, and you try to change it to be part of a covered range while it is in this state, this may be causing a problem. So, when you are about to add covered cells, you might try saving the current cell location, calling grid.CurrentCell.MoveTo(-1, -1) (this leaves the grid with no current cell), then set your coverered range, and then call grid.CurrentCell.MoveTo to restore the current cell to the saved position. If you can post a sample showing the problem, we can look into it here.

Loader.
Live Chat Icon For mobile
Up arrow icon