Solved

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

Posted on 2010-09-23
3
960 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

808 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