Select grid rows based on certain condition in Vue Grid component

16 Mar 20233 minutes to read

You can select the specific row in the grid based on a certain condition by using the selectRows method in the dataBound event of Grid.

In the below demo, we have selected the grid rows only when EmployeeID column value greater than 3.

    <div id="app">
        <ejs-grid ref='Grid' :dataSource='data' :allowPaging='true' height='280px' :rowDataBound='rowDataBound' :selectionSettings='selectionOptions' :dataBound='dataBound'>
                <e-column field='OrderID' headerText='Order ID' :isPrimaryKey='true' textAlign='Right' width=100></e-column>
                <e-column field='CustomerID' headerText='Customer ID' width=120></e-column>
                <e-column field='EmployeeID' headerText='Employee ID' textAlign='Right' width=120></e-column>
                <e-column field='ShipCity' headerText='Ship City' width=80></e-column>
                <e-column field='ShipCountry' headerText='Ship Country' width=120></e-column>
import Vue from "vue";
import { GridPlugin,Toolbar, Page } from "@syncfusion/ej2-vue-grids";
import { employeeData } from './datasource.js';


export default {
  data: () => {
    return {
      data: employeeData,
      selectionOptions: { type: 'Multiple' },
      selIndex: []
  methods: {
      if (['EmployeeID'] > 3) {
      if (this.selIndex.length) {
          this.selIndex = [];
  provide: {
    grid: [Page]
  @import "../node_modules/@syncfusion/ej2-vue-grids/styles/material.css";