Within a vb asp.net webform I have a select case statement within a gridview databound procedure which is based on the values from a dropdown list as stored in a variable.
Protected Sub gvProgressGrid_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvProgressGrid.DataBound
Dim strYear As String = DdlYear.Text
Select Case strYear
Case 11
gvProgressGrid.Visible = True
Case 10
gvProgressGrid.Visible = True
Case 9
gvProgressGrid.Visible = True
Case 8
gvProgressGrid.Visible = False
Case 7
gvProgressGrid.Visible = False
End Select
End Sub
As default the gridview displays and when I select 7 or 8 from the dropdown the gridview disappears ok. However, once disappeared if I select 9-11 then the grid doesn't reappear.