Murray Brown
asked on
ASP.net VB.net hide footer cells of GridView
Hi
I use the following code to hide the header and footer rows of my ASP.net GridView. It works with the header but not the footer.
Why would this be?
Private Sub GridView1_RowCreated(sende r As Object, e As GridViewRowEventArgs) Handles GridView1.RowCreated
Try
If blnHideUnusedColumns = True Then
If e.Row.RowType = DataControlRowType.DataRow Then
If strHideGridColumns <> "" Then
Dim arrSplit As Object = Split(strHideGridColumns, ",")
Dim oColumnIndex As Integer
For i As Integer = 0 To UBound(arrSplit)
If IsNumeric(Trim(arrSplit(i) )) = True Then
oColumnIndex = CInt(Trim(arrSplit(i)))
GridView1.HeaderRow.Cells( oColumnInd ex).Visibl e = False
e.Row.Cells(oColumnIndex). Visible = False
GridView1.FooterRow.Cells( oColumnInd ex).Visibl e = False
End If
Next
End If
End If
End If
Catch ex As Exception
Response.Write(ex.Message & " s34")
End Try
End Sub
I use the following code to hide the header and footer rows of my ASP.net GridView. It works with the header but not the footer.
Why would this be?
Private Sub GridView1_RowCreated(sende
Try
If blnHideUnusedColumns = True Then
If e.Row.RowType = DataControlRowType.DataRow
If strHideGridColumns <> "" Then
Dim arrSplit As Object = Split(strHideGridColumns, ",")
Dim oColumnIndex As Integer
For i As Integer = 0 To UBound(arrSplit)
If IsNumeric(Trim(arrSplit(i)
oColumnIndex = CInt(Trim(arrSplit(i)))
GridView1.HeaderRow.Cells(
e.Row.Cells(oColumnIndex).
GridView1.FooterRow.Cells(
End If
Next
End If
End If
End If
Catch ex As Exception
Response.Write(ex.Message & " s34")
End Try
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER