LessThanDot Site Logo

LessThanDot

A Technical Community for IT Professionals

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Highly Rated Users

Forum
No Posts Rated

Top 50
Given
Received

Links

Wiki
Blog

Forum Statistics

Users
Members:
1884
Members Online:
0
Guests Online:
48

Total Post History
Posts:
81457
Topics:
18718

7-Day Post History
New Posts:
1
New Topics:
0
Active Topics:
1

Our newest member
manails232x

Other

FAQ
All times are UTC [ DST ]

loop through a gridview?

Please wait...

loop through a gridview?

Postby akpaga on Sun Sep 11, 2011 1:12 am

Hi friends

i have a gridview with id gvcustomers...it has tow columns latitudes and longitudes

i want to loop thoiugh the gridview on the client side and get the values

like this...but the problem i have is mentioned in the comments below


var theGridView = document.getElementById('<%=gvCustomers.ClientID%>');

for (var rowCount = 1; rowCount < theGridView.rows.length; rowCount++) {


/// the numbers in the array are lats and longs which are hard //coded...this where i want the latitude and longitude colmn to come..
var latlongs = new Array(new VELatLong(45, -110), new VELatLong(45, -114), new VELatLong(45, -90), new VELatLong(45, -95));



// }

How can i achieve this...thank you
akpaga
Senior Apprentice
Senior Apprentice
LTD Bronze - Rating: 3
 
Posts: 180
Joined: Wed May 27, 2009 4:15 pm
Unrated

Re: loop through a gridview?

Postby akpaga on Mon Sep 12, 2011 3:36 am

got it to work the code below is posted so someone may need it later on..



var grid = document.getElementById("<%= gvCustomers.ClientID %>");

if (grid.rows.length > 0) {

//**looping through the gridview 'gvAssignedTickets'to get the latitude,longitude for each customer
for (i = 1; i < grid.rows.length; i++) {

var somename = grid.rows[i].cells[0].innerHTML; //first cell of row...

your logic here

}
}
akpaga
Senior Apprentice
Senior Apprentice
LTD Bronze - Rating: 3
 
Posts: 180
Joined: Wed May 27, 2009 4:15 pm
Unrated