Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i'm able to get rows.length and i' m looping through it in order to count no.of cells

C#
for (i = 0; i < dlOption.rows.length; i++) {
                       n = n + dlOption.rows[i].cells.length
                   }


But here the problem is

if suppose my datalist contains 2 rows with four columns each, then I'm getting count as 8

But actually it cosnsits 5 items in two rows i have to get exact item count in javascript


where dloption is my rendered datalist in viewsource
Posted
Updated 27-May-14 21:49pm
v2
Comments
Naz_Firdouse 28-May-14 4:53am    
what is your exact output???
Member 10843538 28-May-14 5:24am    
8

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900