i have a gridview and i have made table in gridview and in table i have bound some controls
but i am unable to find control. if i am not using table in gridview then i am not facing the problem but when i am using table in gridview then i am facing this problem please send me a solution of this problem.
Nitin Chotwa...
Member
12 Points
25 Posts
control find in gridview?
Dec 02, 2010 06:28 AM|LINK
dear all........
i have a gridview and i have made table in gridview and in table i have bound some controls
but i am unable to find control. if i am not using table in gridview then i am not facing the problem but when i am using table in gridview then i am facing this problem please send me a solution of this problem.
byeeeeeeeeeeeeeeeeee
"<asp.net>"
vinz
All-Star
126896 Points
17922 Posts
MVP
Re: control find in gridview?
Dec 02, 2010 07:31 AM|LINK
You'll have to use FindControl method to access controls within the GridView.
MessageBox Controls for WebForms | Blog | Twitter | Linkedin
prathamjain2...
Member
743 Points
569 Posts
Re: control find in gridview?
Dec 02, 2010 08:32 AM|LINK
Hiii Nitin Chotwani,
U should use findcontrol method for the same like below-
Label lab=(Label)Gridview1.Selectedrow.findcontrol("labelid");
or
Label lab=(Label)Gridview1.rows[1].findcontrol("labelid");
Hope it helps,
Thanx and regards,
Pratham
Please mark as answer if this post helps u
ajitsatpathy
Member
318 Points
99 Posts
Re: control find in gridview?
Dec 02, 2010 08:54 AM|LINK
If you have used runat="server" with that table, then only you face problem. Otherwise you can find those controls by FindControl method.
http://webxpertstalk.blogspot.com/
Nitin Chotwa...
Member
12 Points
25 Posts
Re: control find in gridview?
Dec 02, 2010 09:15 AM|LINK
Thank you Bhai