Link to home
Create AccountLog in
Avatar of ASPDEV
ASPDEV

asked on

Get Gridview Row Value on any Cell Click using JQuery

Hello Experts,

I need Gridview Cell values on click of any row in the grid using Jquery. For instance, I have a grid like this:

  ID                 NAME                  DOB
    1                JOHN            01/12/1955
    2                DAVID           05/12/1974


If I click on cell JOHN , it should pull up whole row data i.e 1 JOHN 01/12/1955, the same case if I click on Cell ID =2, then it should get 2 DAVID 05/12/1972. I just need values of the whole row on any cell click.

Thanks,
ASPDEV
ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of ASPDEV
ASPDEV

ASKER

I tried this for row data and it worked.
  var selectedRow = $(this);
  var id =  selectedRow.children(0)[0].innerText);
  var name =  selectedRow.children(0)[1].innerText);
  var dob=  selectedRow.children(0)[2].innerText);

Open in new window

Avatar of ASPDEV

ASKER

Thanks.
Avatar of ASPDEV

ASKER

How can I get the Row value of an Invisible column.
I do not think it is possible because it will not be rendered. In  any case analyze your html apge with IE developer tools and check if you can see the column.