Solved

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

Posted on 2010-09-23
3
958 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
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 500 total points
ID: 33752291
-In js code, use: var index = <%=grdName.SelectedIndex%>;
0
 
LVL 35

Author Closing Comment

by:Miguel Oz
ID: 33794826
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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.
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now