Asp.net 2.0 GridView: How to get SelectedIndex-property on the client

How to get SelectedIndex property on the client (Javascript)?
In Asp.net 2.0, the page contains a GridView and ODS. Basically, I need to to identify the selected row in the client browser to implement some js functions.
LVL 36
Miguel OzSoftware EngineerAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
thaytu888888Connect With a Mentor Commented:
-In js code, use: var index = <%=grdName.SelectedIndex%>;
0
 
rockiroadsCommented:
On a gridview, I think its the SelectedRow method that gives you what you want. That call returns a GridViewRow object.

You can then use this to get the row number. I think its RowIndex

yourgrid.SelectedRow.RowIndex might do it

something like that anyways
0
 
Miguel OzSoftware EngineerAuthor Commented:
Thanks
0
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.