# Select Grid Rows When Specific Buttons are Pressed.

## Environment

<table>
    <tbody>
	    <tr>
	    	<td>Product Version</td>
	    	<td>3.10.0</td>
	    </tr>
	    <tr>
	    	<td>Product</td>
	    	<td>Progress® Kendo UI for Vue</td>
	    </tr>
    </tbody>
</table>

## Description

This KB article demonstrates how you can limit the rows' selection of the Grid by pressing specific keyboard keys. In the following example the rows of the Grid can be selected or deselected only when the Shift, Ctrl or Command(for Mac) keyboard buttons are pressed.

**KB sections**

* [Solution description](https://www.telerik.com/kendo-vue-ui/components/knowledge-base/grid-select-row-when-shift-ctrl-command-are-pressed#solution-description)
* [Runnable example](https://www.telerik.com/kendo-vue-ui/components/knowledge-base/grid-select-row-when-shift-ctrl-command-are-pressed#runnable-example)

## Solution description

To achieve the following scenario, we use the [onRowClick](https://www.telerik.com/kendo-vue-ui/components/grid/api/gridprops#onrowclick) event of the Grid and the following code:

```jsx
onRowClick(event) {
    if (event.event.metaKey || event.event.ctrlKey || event.event.shiftKey) {
    event.dataItem[this.selectedField] =
        !event.dataItem[this.selectedField];
    }
}
```

### Runnable example

To test the following example press `Ctrl`, `Shift` or `Command(for Mac)` buttons and click on selected Grid row.

[Demo Source](https://demos.telerik.com/kendo-vue-ui/knowledge-base/grid-select-row-when-shift-ctrl-command-are-pressed/source.txt)
