Click here to Skip to main content
15,884,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to find an image button placed inside a gridview control which is in a tab container.I need to display images on the screen in a gridview.

kindly send me the code for the above as soon as possible.

Thank you
Ancie Varghese
Posted

1 solution

hi,

try this,

C#
GridView grd  = (GridView)tabContainer1.SelectedTab.FindControl("GRidView1");
ImageButton imgBtn = (ImageButton)grd.Items[0].FindControl("ImageBtnID");

//This will find the image button contain in first row of the grid view. similarly you can find other controls

//your code goes here

Hope it works.
 
Share this answer
 
Comments
Ancie Varghese 12-Sep-12 4:53am    
hi karthik,i tried that code but it dint work.It'll find the grid but not the imagebutton inside the grid.please reply if you have any other suggestions.Thank you
Karthik Harve 12-Sep-12 4:55am    
Where exactly your image button. is it in ItemTemplate of the gird ?
Ancie Varghese 17-Sep-12 6:44am    
karthik sorry for the delay, the image button is placed inside the gridview.the gridview is inside a tab container.

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