Griven
Griven

Reputation: 183

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?

Upvotes: 4

Views: 5154

Answers (1)

Griven
Griven

Reputation: 183

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 = [];

Upvotes: 11

Related Questions