Hi Infragistics team,
I'm working with the XamPivotGrid v12.1 and I'm unable to get keyboard navigation (arrow and tab keys) to work in the way requested by our users. On the StartupSolution, I'm not able to get keyboard navigation on the highlighted cell working - when I select a cell and press the right arrow, the grid scrolls to the right but our clients want the highlighted cell to move to the right. Is that possible?
Also, when pressing the tab key, the next cell should be highlighted, but the whole xampivotgrid loses focus and focus is set to the next logical control. Is it possible to set this navigation option as well?
On our production environment, we are using custom editors for the cells (mainly labels which implement the IPivotEditor interface to disable cell editing on certain cells and XamNumericEditors for decimal values). When clicking on a cell, the cell gets highlighted and when using the arrow keys, the highlighted cell stays highlighted and logical focus is shifted to the next cell (which renders the dotted rectangle lines). However, when double clicking on the custom editor cell (either on a Label or XamNumericTextEditor), the "correct" behaviour is observed, as the highlighted cell moves with the arrows.
Is it possible to point me to an article about how keyboard navigation is supposed to work on the XamPivotGrid (as I can't find anything in the documentation and forums) and what would be the right approach to allow users to move from cell to cell with the arrow and tab keys?
Many thanks,
Roman
Hello Roman,
Thank you for the feedback. Please do not hesitate to contact us if you have any questions.
Thanks Gergana, that sample looks good and resolves the issue
I have been further investigating your issue. After the investigation I can suggest that setting the active cell manually is the best approach for this scenario. I have modified the last sample with this functionality. In the sample the KeyDown event is registered and then the active cell get changed. When you press the tab key the next cell on the row gets active and selected. If you press the enter button the new active cell enters in edit mode.
Please refer to the attached sample application and feel free to let me know if you have any further questions on the matter.
Thanks for that Gergana, there's one weird behaviour in your example:
If you allow cell editing, then click on a cell so the control is in edit mode and press the Tab key, the behaviour is inconclusive - the control seems to stay in edit mode (= has the numeric editor) but the dotted rectangles indicating control focus going to the next cell. When you navigate around with the arrow keys and then press Enter, focus goes back to the initial control still being in edit mode.
I'm currently using a custom workaround by handling the preview key down event and manually setting active cells on tab keys, but this is quite fiddely so I'm wondering whether there is any 'out of the box' setting which handles this scenario more gracefully?
Thank you for your post! I have been looking into it and have created a small sample for you. In the sample I have a flat data source and you can see the default behavior for the keyboard navigation. When you expand the columns of the xamPivotGrid and press the left/right arrow key the it navigates to the cell to left or right depending if you have pressed the left or right arrow key.
When you press the tab key the next cell in the grid gets selected (the one on the right side).
Please refer to the attached sample and feel free to let me know if you have any further questions on the matter