Click here to Skip to main content
12,350,831 members (28,046 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Javascript ASP.NET4
hi..

I am trying to access current selected gridview cell in javascript.provide soln.thanx
Posted 19-Sep-12 19:15pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hi Vijay,
U can follow this link. Actually it is related to jquery.

http://api.jquery.com/category/selectors/?rdfrom=http%3A%2F%2Fdocs.jquery.com%2Fmw%2Findex.php%3Ftitle%3DSelectors%26redirect%3Dno[^]

Different kinds of selectors are given here. Hope it is useful for u.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hi Vijay,

Kindly look into this link.......

http://jquerybyexample.blogspot.com/2012/05/get-aspnet-gridview-cell-value-on-click.html[^]

This might be very useful then previous one.
  Permalink  
Comments
Abhijit Parab 20-Sep-12 3:23am
   
See vithal,
Instead of distracting him again and again. better to post answer here as he is checking for updates after regular interval. I have posted what i understood from his question.
Better provide solution or suggestion related to the answer rather then going personally. In future should not post such comments like seating arrangements or telling verbally this may spoil your and my reputation. Others may create doubt about our membership.
Please don't do this again
Abhijit Parab 20-Sep-12 5:37am
   
I dont want to fight vijay with anyone. But just see the comment bcoz not only u and me but also all over the world users are using this site. what they will think. We are here to learn and help others not make such irrelevent comments.
I appologies if i have said something wrong.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

yeeeeeeeeeeeeeee...........................................

i got answer
javascript code

var gdv=document.getElementById('gridviewId');
var activeCell=gdv.document.activeElement.cellIndex;
var activeRowIndex=gdv.document.activeElement.parentElement.rowIndex;

so my selected cell in activeRowIndex row with cell index activeCell
  Permalink  
Comments
Abhijit Parab 20-Sep-12 5:03am
   
Congrats Vijay..............
All the best :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 20 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100