[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

ASP.net VB.net hide footer cells of GridView

Posted on 2016-10-28
2
Medium Priority
?
109 Views
Last Modified: 2016-10-28
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(sender 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(oColumnIndex).Visible = False
                                e.Row.Cells(oColumnIndex).Visible = False
                                GridView1.FooterRow.Cells(oColumnIndex).Visible = False
                            End If
                        Next

                    End If

                End If

            End If
        Catch ex As Exception
            Response.Write(ex.Message & " s34")
        End Try
    End Sub

1
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Ryan Chong earned 2000 total points
ID: 41863518
in the condition:

If blnHideUnusedColumns = True Then

Open in new window


you may add:
If e.Row.RowType = DataControlRowType.Footer Then
        e.Row.Visible = false
End If

Open in new window

0
 

Author Closing Comment

by:Murray Brown
ID: 41863675
Thanks very much
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question