aspnet-js-aspxclientgridview-dot-unselectrowsbykey-x28-keys-x29.md
Deselects the rows specified by their key values.
UnselectRowsByKey(
keys: any[] | any
): void
| Name | Type | Description |
|---|---|---|
| keys | any |
The key values of the rows.
|
The UnselectRowsByKey(keys) method sends a callback to the server to apply the row selection.
When the row selection changes, the control raises the client-side ASPxClientGridView.SelectionChanged or the server-side ASPxGridBase.SelectionChanged event (based on the ProcessSelectionChangedOnServer property value).
To select the rows specified by their key values, call the SelectRowsByKey(keys) method.
For more information on row selection in grid, refer to the following topic: Selection.
<dx:ASPxGridView ID="grid" ClientInstanceName="grid" KeyFieldName="ProductID" runat="server">
</dx:ASPxGridView>
// Deselect a single row
grid.UnselectRowsByKey(2);
// Deselect multiple rows
grid.UnselectRowsByKey([2,10]);
<dx:ASPxGridView ID="grid" ClientInstanceName="grid" KeyFieldName="ProductID;ProductName" runat="server">
</dx:ASPxGridView>
// Deselect a single row
grid.UnselectRowsByKey("2|Chang");
// Deselect multiple rows
grid.UnselectRowsByKey(["2|Chang","10|Ikura"]);
See Also