Solved

Windows vb.net datagridview vertical grid only

Posted on 2009-04-07
5
1,114 Views
Last Modified: 2012-05-06
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
Comment
Question by:George
  • 3
  • 2
5 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 24089592
Hi jguinard,

What you mean with that ?
0
 

Author Comment

by:George
ID: 24089640
that only vertical lines are displayed, not the horizontal lines.
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 24089687
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
 

Author Closing Comment

by:George
ID: 31567616
Thank you very much jpaulino!
It works Perfectly!  :)
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 24090342
Glad I could help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

929 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now