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
250
Arrow Key Navigation
posted

I am trying to make a grid that navigates with the arrow keys like excel. I followed the sample posted and was able to make it work but there is a hitch.

My grid has multiple levels and I have a number of stacked columns. When I am in the lower cell of the stacked cells and arrow up it moves up a row, when all I want it to do it is move up a cell in the same row.  Any idea how to make it work?

-Kim

  • 469350
    Offline posted

    Hi Kim,

    Are you using Groups and Levels? Or a RowLayout?

    Either way, I don't think the grid can know which cell you want to move to. So what you would probably have to do is handle the KeyDown event of the grid, determine which cell currently has to the focus, set the ActiveCell to the cell you want. Then you call PerformAction(EnterEditMode) to enter edit mode on that cell, if you like. You will also need to mark the event handled.