Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear selection for Kendo Grid in Angular 2

I've got an application that allows a user to select a row in a Kendo Angular 2 grid and click a button that removes that row. After the row is removed, however, the grid selection persists on the index of the row that was just removed. I'd like to clear the grid's selection after the button is clicked and the row is removed. For the life of me, I cannot find a way to do this. Any ideas?

like image 325
Griven Avatar asked Nov 08 '25 09:11

Griven


1 Answers

The Kendo Grid control has a property of "selectedKeys" which binds to an array of numbers. You can then clear this array when you want to clear the selection of the grid.

<kendo-grid
[selectedKeys]="mySelection"></kendo-grid>

In your code:

this.mySelection = [];
like image 98
Griven Avatar answered Nov 12 '25 07:11

Griven



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!