Click here to Skip to main content
15,899,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have gridview.
May i know how to get values from the row the user clicks on gridview into the textboxes..

Thanks in advance
Posted

You can do it by using SelectedIndexChanged event of the gridview. Other ways also there. You can use this event. Get the SelectedDataKey and corresponding details in this event.
 
Share this answer
 
Comments
dhage.prashant01 9-Jun-10 3:05am    
May i get an example to refer..??
Arun Jacob 9-Jun-10 3:06am    
Try this,
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.selectedindexchanged.aspx
Add Select command field in your gridview.

in gridview_SelectedIndexChanged event do code as:

Textbox1.Text=gridview1.selectedrow.cell(1).text

Here, 1 is the column of gridview.

Happy Coding :)
 
Share this answer
 

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