Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET GridView row count using Javascript

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)

like image 790
tivo Avatar asked Jan 22 '23 23:01

tivo


1 Answers

var rowscount = document.getElementByID('<%=Gridview1.ClientID%>').rows.length;

alert(rowscount);
like image 151
TStamper Avatar answered Jan 26 '23 12:01

TStamper