We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to select or highlight rows based on data?

Platform: jQuery |
Control: ejGrid


You can select or highlight rows based on data using the queryCellInfo event or can also select a row using an external button click event.

The queryCellInfo is triggered every time a request is made to access particular cell information, element and data.

In the argument of the queryCellInfo event, you can obtain the following details.




Returns Grid cell


Returns the cancel option value


Returns current row record object


Returns the text value in the cell


Returns the column object


Returns the foreignkey record object


Returns the grid model


Returns the name of the event


By comparing the value obtained from the argument of the queryCellInfo event, you can select the corresponding data rows using the selectRows() method of the Grid.


In the following example, the records based on the field EmployeeID are highlighted/selected.

  1. Render the Grid.






  1. In the queryCellInfo event, custom Css to the rows with EmployeeID greaterThan 3 and lessThan 6 is applied.


  1. In order to select the rows based on the value/data in the Grid, you can use the selectRows method and pass the index of the row as argument.


  1. In order to select the rows based on a data externally using a button, you can use the selectRows method within the click event of the button.



Figure 1: Select/ highlight rows based on the data on row/grid


Figure 2: Select rows dynamically based on data on row/grid

You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile