It is necessary to hide the checkbox in the table header when all checkboxes in other rows are hidden.
if ($('#Submit').css('display', 'none')) {
$("#chselect").hide();
} else if($('#Submit').css('display') == 'none'){
$("#chselect").show();
}