• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1191
  • Last Modified:

Windows vb.net datagridview vertical grid only

Hi Everyone,

In a vb.net 2005, Windows application:

I need to display only the vertical lines on a datagridview.

How can I do that?

TIA
0
George
Asked:
George
  • 3
  • 2
1 Solution
 
Jorge PaulinoIT Pro/DeveloperCommented:
Hi jguinard,

What you mean with that ?
0
 
GeorgeAuthor Commented:
that only vertical lines are displayed, not the horizontal lines.
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Ok, you can use the CellPainting to change the BorderStyle like this:
    Private Sub DataGridView1_CellPainting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
        e.AdvancedBorderStyle.Bottom = DataGridViewAdvancedCellBorderStyle.None
        e.AdvancedBorderStyle.Top = DataGridViewAdvancedCellBorderStyle.None
    End Sub

Open in new window

0
 
GeorgeAuthor Commented:
Thank you very much jpaulino!
It works Perfectly!  :)
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Glad I could help!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now