Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to find control inside the Gridview.Can we take it from findcontrol..
Posted

in rowdatabound event you can access this like

e.row.findcontrol("id of control you want to find");


if in row command u want to find then

if linkbutton in your grid is clicked then

GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
 
Share this answer
 
Comments
hitech_s 10-Oct-11 1:19am    
if anybody down voting me you need to give explanation for this..
C#
foreach (GridViewRow row in gridview.Rows)
{
RadioButton rbn=new RadioButton();
 
rbn=(RadioButton)row.findcontrol("radiobutton id");
//place your code after finding control
}
 
Share this answer
 
Comments
Herman<T>.Instance 15-Sep-11 6:45am    
don't forget to check if (rbn != null) ==> means object is found!
go to this link
Gridview
 
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