Question : GridView Hide Column Problem

I am trying to hide the gridview column if every row in the column is empty. I tried below, it does remove column if it finds a empty value, problem is it should only hide if all the values in column is blank, any ideas. I played with the GridView1.Columns(i).Visible = True Part, but it seems once it gets rid of column it won't bring it back.

Any ideas?


        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim i As Int16, strCell As String
            For i = 0 To e.Row.Cells.Count - 1
                strCell = Trim(e.Row.Cells(i).Text)
                If strCell = " " Then strCell = ""
                If String.IsNullOrEmpty(strCell) Then
                    GridView1.Columns(i).Visible = False

                Else
                    GridView1.Columns(i).Visible = True
                End If

            Next i

Answer : GridView Hide Column Problem

Windows takes a few minutes to finish loading all services.  It depends on your speed of your cpu, speed of your hard drive and how much RAM you have.

Try removing the free AVG and see what happens.  If problem persists, do a defrag analyze and defrag the hard drive if it needs it that will speed up the Windows loading.
Random Solutions  
 
programming4us programming4us