Having the GridView client control ID, I would like to get some ideas on how to count the GridView rows or at least be able to tell if there is at least one row on the Gridview the restriction is that I can only use client side code (JavaScript in this case)

share
up vote 9 down vote accepted
var rowscount = document.getElementByID('<%=Gridview1.ClientID%>').rows.length;

alert(rowscount);
share

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.