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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to select or highlight rows based on data?


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

Article ID: Published Date: Last Revised Date: Platform: Control:
2979 11/28/2014 08/06/2015 JavaScript ejGrid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

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

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