Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2010-09-23
3
Medium Priority
?
977 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:Miguel Oz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 33751273
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
 
LVL 6

Accepted Solution

by:
thaytu888888 earned 1500 total points
ID: 33752291
-In js code, use: var index = <%=grdName.SelectedIndex%>;
0
 
LVL 36

Author Closing Comment

by:Miguel Oz
ID: 33794826
Thanks
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question