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 customize select all checkbox behavior in grid header

Platform: jQuery |
Control: ejGrid

This Knowledge base explains how to customize the behavior of the header checkbox when checkbox selection is used.


We have achieved this using rowSelecting and actionComplete events of ejGrid. By default, when the header checkbox is checked all the rows of the Grid will be selected.

If we need to select only specific rows based on some condition then we need to prevent the default behavior of the header checkbox in the rowSelecting event and bind a click event to the header checkbox.

The following code example demonstrates how to select only specific rows when header checkbox is checked.

1.Render the Grid control.








2. In rowSelecting event we prevent the default behavior of header checkbox by defining args.cancel as true and bind the click event to the header checkbox.

In the click event of header checkbox select the rows based on the required condition using selectRows method.

To maintain the selection in all the pages we need to call the header checkbox click handler in the actionComplete event.




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