|
Hiding GridView ImageButtons
Published: 4/26/2009 |
|
Quick and dirty today, this is a little tip I stumbled upon that can be infinitely useful. If you have an ImageButton in a column of a GridView (we're talking ASP.NET 3.X here), you can hide the ImageButton without altering the field otherwise (hiding the field itself will alter the row's background color for that cell) simply by setting the Text property of the cell to null. Consider this code which might be in the RowDataBound event of a GridView:
VB:e.Row.Cells(1).Text = Nothing
e.Row.Cells[1].Text = null;
Questions or Comments? .
VB to C# and C# to VB translation provided by Instant C# and Instant VB.