Click here to Skip to main content
11,500,844 members (79,098 online)
Rate this: bad
Please Sign up or sign in to vote.
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 11-Sep-12 22:39pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


try this,

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.
Ancie Varghese at 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 at 12-Sep-12 4:55am
Where exactly your image button. is it in ItemTemplate of the gird ?
Ancie Varghese at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 395
1 Maciej Los 215
2 Peter Leow 215
3 DamithSL 165
4 Ralf Meier 134
0 Sergey Alexandrovich Kryukov 435
1 Maciej Los 345
2 DamithSL 285
3 Peter Leow 260
4 OriginalGriff 177

Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100