Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to count the rows of gridview in asp.net using jquery

<script type="text/javascript">
    $(function () {
        $("[id*=btnGetCount]").click(function () {
            var totalRowCount = $("[id*=GridView1] tr").length;
            var rowCount = $("[id*=GridView1] td").closest("tr").length;
            var message = "Total Row Count: " + totalRowCount;
            message += "
Row Count: " + rowCount;
            alert(message);
            return false;
        });
    });
</script>
 
PREVIOUS NEXT
Tagged: #count #rows #gridview #jquery
ADD COMMENT
Topic
Name
1+2 =