Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
Here my problem is i don't know how to get current row value in dynamic gridview,
i refer this link

Dynamically adding and deleting rows from ASP.NET GridView[^]

For Example:

here i using dynamic gridview, user can add and remove more row in gridview, each row i use column name(quantity), if client add totally two rows and they click first row image(imagebutton) i want to show popup what they are enter in no of quantity column, it similar like second row,

how to do that..

Thank You !
Posted
Updated 28-Jul-14 2:09am
v2
Comments
Inside which event you want to get the Grid Values?
prasanna.raj 28-Jul-14 8:09am    
here i using dynamic gridview, user can add and remove more row in gridview, each row i use column name(quantity), if client add totally two rows and they click first row image(imagebutton) i want to show popup what they are enter in no of quantity column, it similar like second row,

how to do that..
See my answer.

You can use GridView1.SelectedRow property when OnSelectedIndexChanged event occures in the GridView

Check below tutorial

http://aspsnippets.com/Articles/How-to-get-Selected-Row-cell-value-from-GridView-in-ASPNet.aspx[^]
 
Share this answer
 
You can have a CommandName property specified for the ImageButton.
Also declare CommandArgument property like...
HTML
CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"

Then inside the RowCommand Event, check the CommandName and get the details of the Row like...
C#
int index = Convert.ToInt32(e.CommandArgument);

// Retrieve the row that contains the button clicked 
// by the user from the Rows collection.      
GridViewRow row = ProductsGridView.Rows[index];

Complete example at - GridView.RowCommand Event[^]
 
Share this answer
 
Comments
prasanna.raj 29-Jul-14 2:13am    
Ya thaks i have tried more times but now i got it thanks lot...
Great news. :)

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