Click here to Skip to main content
15,888,323 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi All,,

I am adding a textbox and dropdown value in Gridview on button click through javascript by creating elements one by one in each cell of the gridview Row.

I am successfull till that..
but now i want to edit the records which were previously added in gridviw through javascript.

For that i need to get the index of the row of whom edit button was clicked.

Can anybody help me to get that??

NOTE: I am adding textbox value in cell[0], dropdown value in cell[1], Edit button in Cell[2]

Kindy Help.
Posted
Comments
In that case, you need to analyse the html generated and try to get the controls by jQuery.
vinay.tatipamula 17-Jul-13 5:06am    
You can use jquery $(rowobject).index() to get the row index..
VICK 18-Jul-13 0:01am    
and how can i get the rowobject ????

You can use KendoUI Grid
http://demos.kendoui.com/web/grid/editing-inline.html[^]
Which is totally JavaScript. Please Try.
 
Share this answer
 
Comments
VICK 18-Jul-13 0:00am    
Dear I dont need opensource solution...I need simple piece of code in javascript.

Any Ways Thanks for your help.. :)
Bind a click event on your Edit button and get the index of the row object some thing like below.


JavaScript
var rowIndex = $('#your edit button id').parent().parent().index();
 
Share this answer
 
v3

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900