Handle PreRender event for the gridview. In the event loop through the Rows
collection. For every row use Cells collection to locate the column. Once on
the column, use FindControl method to locate controls inside the template.
Button btn = myGridView.Rows[i].Cells[j].FindControl(myButton1) as Button;
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin http://usableasp.net
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:Of**************@TK2MSFTNGP03.phx.gbl...
>I have a GridView control with one column a TemplateField that contains two
buttons. I'd like to hide one or both button based on the row number.
Can anyone provide some tips on how I can do this?
Thanks.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com