Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
Stopping arrow keys moving to the next line
posted

Hi,

This should be the simplest thing but I've had real issues trying to get it working. Does anyone know how to alter the behaviour of the XamDataGrid so that when your in the last column and press the right arrow it dosen't jump down to the first column of the next line (simular to left arrow)? I.e. behave more like Excel does. I've tried hooking into ExecutingCommand and catching the CellRight/CellLeft commands but while this works most of the time, occasionally (when key pressed a lot) something else gets called and it jumps to the undesired location.

thanks

Parents
No Data
Reply
  • 69686
    posted

    Hello,

    Handling and canceling the ExecutingCommand event is the recommended approach. Can you provide us with an example of when this incorrect behavior occurs. Another way would be to handle the PreviewKewDown event of the XamDataGrid and handle it for the left and right arrow keys if the active cell is respectively in the beginning or end of the record.

Children