I suppose the looping of control hierarchy is the single way,
because your items are inside other control and u need find them somehow

Signature
WBR, Michael Nemtsev [.NET/C# MVP].
Blog: http://spaces.live.com/laflour
> I have a situation where I need to condition gridview item visibilty
> after they've been created and after a textbox on page has a value.
[quoted text clipped - 3 lines]
>
> Seems like it might be messy.
Eliyahu Goldin - 12 Dec 2007 09:19 GMT
Do it in the PreRender event.

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
>I suppose the looping of control hierarchy is the single way,
> because your items are inside other control and u need find them somehow
[quoted text clipped - 6 lines]
>>
>> Seems like it might be messy.
jc - 12 Dec 2007 11:57 GMT
Does anybody have any vb.net example of looping through the gridview
and setting visibility of an item after it's been built?
gnewsgroup - 12 Dec 2007 13:38 GMT
> Does anybody have any vb.net example of looping through the gridview
> and setting visibility of an item after it's been built?
I think you can do something like this (in C#, I am not good at VB):
foreach (GridViewRow gvr in MyGridView.Rows)
{
// If you know the column index, you can do:
gvr.Cells[2].Visible = false;
// Or if you want to make some control in that cell
invisible:
TextBox myTextBox = (TextBox)gvr.FindControls("myTextBox");
myTextBox.Visible = false;
}
The code hasn't been tested, but you get the idea.
gnewsgroup - 12 Dec 2007 13:56 GMT
> Does anybody have any vb.net example of looping through the gridview
> and setting visibility of an item after it's been built?
It's been answered here:
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_t
hread/thread/2e26393b256aff43/c923a8cca6231531?hl=en#c923a8cca6231531