Solved

Windows vb.net datagridview vertical grid only

Posted on 2009-04-07
5
1,145 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
[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
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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