Here Mudassar Ahmed Khan has explained with an example, how to check all (select all) CheckBoxes in WebGrid using a CheckBox in Header row in ASP.Net MVC Razor.
The first column of WebGrid will contain the CheckBoxes and the check all (select all) CheckBoxes functionality will be implemented using jQuery in ASP.Net MVC Razor.
When the Header row CheckBox is checked (selected), all the row CheckBoxes will be checked (selected) and when the Header row CheckBox is unchecked (deselected), all the row CheckBoxes will be unchecked (deselected).