I inherited from UltraWinGrid to customize some settings at runtime. In my test project the grid behaves as expected. In a more complex real project the up and down keys move to the next / previous cell.
For testing purposes I cleared the KeyActionMappings of the grid and set 4 mappings for the up/down/left/right keys and disabled the OnKeyDown / OnKeyPress methods I had before.
If I call PerformAction (UltraGridAction.BelowCell) this results in a move to NextCell as well.
Any ideas would be appreciated
Burkhard
Hi Burkhard,
I'm afraid I don't understand what you are asking. What is the behavior you want? And what behavior are you getting?
Mike,
I press the down-key on the keyboard and would like the cell below the active cell to be activated, instead the cell right to the active cell is beeing activated. Similarly pressing the up key does not activate the cell above but the cell left of the originally active cell.
I see the same strange behaviour if I issue the actions "BelowCell" and "AboveCell" programatically instead of pressing keys.
Again, this happens in one grid, two other grids behave as expected. I have no idea, where to look. Additional information : The offending grid is placed on a docking pane.
Hm. I can't see any reason why AboveCell or BelowCell should behave this way. Perhaps the difference is that some of your grids are using RowLayouts and some are not. In a RowLayout, the grid might not be able to determine what BelowCell means exactly, since the cells don't neccessarily line up.
Check the UseRowLayout (or RowLayoutStyle if you are using v9.1) on the grids and see if that is the difference.
You might also want to check out this KB article: HOWTO:UltraWinGrid Cursor Movement like Excel
Mike, the KB entry http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=1997 you suggested is really good.However I notice one deficiency.
In Excel, I notice there are two modes . In one mode, on using cursor right/left keys, Excel lets to go to the right/left cell . In other mode it lets you move right/left WITHIN the cell you are in.
Reading the KB code, it is does not look like it would behave like Excel with giving us the two modes, i.e. navigate from cell to cell and navigation within cell.
Thanks
Vinay
PS: I hope the Excel modes is clear. It is hard to describe. Hopefully you can try it in Excel if not clear.
Hi Vinay,
The difference is whether the cell is in edit mode (in which case the arrow keys would work to move the cursor within the cell) or not (in which case the arrows move between cells). I'm pretty sure the sample code works for that, but if I am wrong, all you have to do is check grid.ActiveCell.IsInEditMode and bail out if it's true.