C
Chris
I have a nested gridview. I want the nested gridview to be invisible by
default but to become visible when a button is clicked in its parent. The
code below handles this toggling well when the nested gridview visability
starts at true. When I set it to false the toggle no longer works. I can
some movement on the page and when I step through the code I can see the
visability toggling but the nested gridview remains invisible. It's probably
something stupid but I can't think.
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
GridView1.RowCommand
Dim gv As GridView = DirectCast(sender, GridView)
Dim rowIndex As Integer = e.CommandArgument
Dim childgv As GridView =
DirectCast(gv.Rows(rowIndex).FindControl("gridview2"), GridView)
childgv.Visible = Not childgv.Visible
End Sub
default but to become visible when a button is clicked in its parent. The
code below handles this toggling well when the nested gridview visability
starts at true. When I set it to false the toggle no longer works. I can
some movement on the page and when I step through the code I can see the
visability toggling but the nested gridview remains invisible. It's probably
something stupid but I can't think.
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
GridView1.RowCommand
Dim gv As GridView = DirectCast(sender, GridView)
Dim rowIndex As Integer = e.CommandArgument
Dim childgv As GridView =
DirectCast(gv.Rows(rowIndex).FindControl("gridview2"), GridView)
childgv.Visible = Not childgv.Visible
End Sub