Hi,
I have a simple grid:
- no paging
- client side row selection allowed (single selection)
I have the id of the last selected row (let's say (for simplicity) - it's index in the grid) stored somewhere (let it be Session). When I load the page with this grid I want to select this row automatically.
I do the following (all client side):
- hook to GridCreated event
- supply the event handler like this:
OK, it seems to work well. The desired row gets automatically selected. When I click on any other row - the previous gets deselected, the new one - selected.
But when I click on an already selected row (the last selected one, not neccessarily this <stored row index> one) this row gets deselected and the subsequent clicks don't want to select it.
If I comment out this "set_selected" statement selecting and deselecting works as expected.
It is independent from the used browser.
What should I do to achieve my goal?
Regards
Tomasz
I have a simple grid:
- no paging
- client side row selection allowed (single selection)
I have the id of the last selected row (let's say (for simplicity) - it's index in the grid) stored somewhere (let it be Session). When I load the page with this grid I want to select this row automatically.
I do the following (all client side):
- hook to GridCreated event
- supply the event handler like this:
| function GridCreatedHandler(sender, eventArgs) { |
| var master = sender.get_masterTableView(); |
| master.get_dataItems()[<stored row index>].set_selected(true); |
| } |
But when I click on an already selected row (the last selected one, not neccessarily this <stored row index> one) this row gets deselected and the subsequent clicks don't want to select it.
If I comment out this "set_selected" statement selecting and deselecting works as expected.
It is independent from the used browser.
What should I do to achieve my goal?
Regards
Tomasz