I forgot how autogenerated gridview HTML markup is rendered in the browser, but you can try escaping the first
<tr>
of the table. Your code would now look something like this:
$('input[id$=txtSearch]').keyup(function () {
_this = this;
$.each($("[id*=grd]").find("tr:not(:first)"), function () {
if ($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) == -1)
$(this).hide();
else
$(this).show();
});
});
The key there is to use the jQuery selector
tr:not(:first)
to prevent the first row to be hidden.
You can also try looking at QuickSearch plugin as demontrated in this article here:
https://www.aspsnippets.com/Articles/Implement-Client-Side-search-in-GridView-using-jQuery-in-ASPNet.aspx[
^]