column.For(x => Html.CheckBox("mycheckbox", new { @class = "foo" }))
.DoNotEncode()
.Header("<th><input type=\"checkbox\" id="chkHeader" /></th>");
And then you could use jquery to handle the change event of the header checkbox and check/uncheck all the others:
$(function() {
$('#chkHeader').change(function() {
if ($(this).is(':checked')) {
$('.foo').attr('checked', 'checked');
} else {
$('.foo').removeAttr('checked');
}
});
});