Results 1 to 2 of 2

Thread: Hide the Row in the DataGridView

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2010
    Posts
    229

    Hide the Row in the DataGridView

    Hi
    i am working Hide or Unhide Rows in the DataGridView.
    When i click RowHeader the corresponding row is hiding.
    But i don`t want to hide the RowHeader.
    The RowHeader should be visible when i click RowHeader, the remaining row should be hide.
    B`se i want to access the RowHeader again for unhide the row.

    I am using the below code for Hide the Row.

    Code:
    Private Sub datagridview1_rowheadermouseclick(ByVal sender As Object, ByVal e As DataGridViewCellMouseEventArgs) Handles DataGridView1.RowHeaderMouseClick
            Me.DataGridView1.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect
            Me.DataGridView1.Rows(e.RowIndex).Visible = False
            Me.DataGridView1.RowHeadersVisible = True
    
        End Sub
    Regards
    Kumar

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Hide the Row in the DataGridView

    That doesn't seem to make sense. The row header is part of the row. Hiding a row is an all or nothing deal. What you're asking for is hiding some of the cells. In that case you'd end up with a blank space where those cells would have been. What would be the point of that?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width