Hello,
I have a XamGrid with editing turned off, CellClickAction="SelectRow", CellSelection="None", RowSelection="Single". This all works fine as expected using the mouse.
However, navigating with the arrow keys still highlights cells within a row. Likewise, ctrl + end/home goes to the last/first cell in the row.
How can I completely disable all cell navigation within the row, and keep only vertical navigation, that is up/down/page up/down/home/end?
Thanks in advance.
Thanks for the reply.
OK, I suspected that would be my only option, but I thought why not ask, maybe I missed some setting.
Thanks for the help.
Hello Cosmin,
Thank you for posting in our forums!
You can customize the keyboard navigation by handling the XamGrid's PreviewKeyDown event. You can check for which keys are pressed and set the e.Handled to true to prevent the grid from processing the key press.
The below example shows how you can prevent the left and right keys from activating the previous/next cells. You can add additional logic for the Home/End buttons depending on your requirements.
private void XamGrid_PreviewKeyDown(object sender, KeyEventArgs e) { e.Handled = (e.Key == Key.Left || e.Key == Key.Right); }
If you have any further questions or concerns with this, please let me know.
Sincerely,Michael H.Software DeveloperInfragistics, Inc.www.infragistics.com/support