Saturday, January 4, 2014

Get GridView Cell value using jQuery ASP.NET

In this tutorial I will show you how you can get the cell value of Grid View using jQuery

You will first need to populate your gridview using any datasource

than using the jquery below

$("#<%=gv1.ClientID %> tr").each(function () {
                    if (!this.rowIndex) return;
                    var row = $(this).find("td:first");
gv1 is the name of our gridview

using the each loop we iterate on each row

td:first indicate that we are only getting value of first column

we can also use

td:eq("index number")
td:gt("Include element that are past the given index")
td:lt("Include element that are before the given index")

I hope it was informative for you and I would like to Thank you for reading