Hi,
On the client side, a grid view is an html table.
In JavaScript, to get the number of rows on an html table, you would check the length of the tables
row collection.
Access your GridView using its ClientID property, and you have a reference to your html table.
Something like this should work:
var gridViewRowCount=document.getElementByID('<%=gv.ClientID%>').rows.length;
... Hope it helps.