How to Get GridView cell values by Javascript in

Hi Expert,

I need to get particular column cell values by JavaScript using FOR LOOP in .

Please send me the javascript code.
Asrar AzmiWeb DeveloperAsked:
Who is Participating?
dejaanbuConnect With a Mentor Commented:
you can use jquery  for this:

add a reference to jquery.js in your project if you are not having already:

then in your specific function, you can do like this:

var list = "";
$("#<%=yourGridView.ClientID %> tr").each(function () {
                    //Skip first(header) row
                   if (!this.rowIndex) return;
                    var test = $(this).find("td:first").text(); //here first cell value is returned
                   list += test + '\n';


Open in new window

or you can use "td:eq(column_index_here)" instead of td:first
Oost the code you already have set up or a link to the page so we have some context.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.