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
690
Space Key on a grid
posted

Hi, I've a grid witch is binded with a datasource. I've a boolean column witch is checked when the user press space key. To do that, I use the grid.selected.Rows.

When I press space on a multiple selection, the activeRow is in the grid.seleted.Rows

and When I Press the space key another time, the activeRow isn't selected and isn't in grid.seleted.Rows

Because of that, when I check the boolean column, I've to test if the activeRow is selected or not to not forgive it :

If I don't modify the boolean column (the grid doesn't enter in edit mode), the grid reacts in the same way.

Could I know why the componant react like that ?

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    By default, the SpaceBar is mapped to selected/unselect a row. From what event are you calling the code you posted here?

    If you are handling one of the grid's Key events, like KeyDown and you are handling the SpaceBar to change the checked state of your boolean column, then you probably just need to set e.Handled to true to indicate that you handled the keystroke and the grid should not handle it again after you.

Children