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 show the toolbar items based on the grid row selected index?

Platform: jQuery |
Control: ejGrid
Tags: grid, toolbar

This Knowledge base explains the way of how to show or hide the toolbar items in grid based on selected row index.


 This can be achieved using rowSelected event of ejGrid. The rowSelected event will get trigger when selecting the rows of the grid and based on the rowIndex (argument in rowSelected event) value the toolbar items in grid can be show or hide.

The following code example demonstrates how to show or hide the toolbar items based on selected row index:


  1. Render the grid control















  1. Using create event we have hide the toolbar items initially.


TS file


  1. Using rowSelected event in grid the required toolbar items can be show or hide based on rowIndex value.





Figure 1: shows the edit icon in toolbar when the selected row index is less than 5




Figure 2: shows the add icon in toolbar when the selected row index is greater than 5 and less than 7.


C:\Users\Manisankar.durai\Desktop\add and delete.png

Figure 3: shows add and delete icon in toolbar items when selected row index is greater than 7.

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