Solved

DataGridView Header Indents

Posted on 2011-02-24
4
1,032 Views
Last Modified: 2012-06-27

Hi

Just a quick question regarding DataGridViews,

Everytime i create a DGV the Headers are always indented slightly whereas the data in the table is not, is there a way to remove the indent or make the data in table indent to the same position?

Thanks in advance for any help.
0
Comment
Question by:STP_Martin24
[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
4 Comments
 
LVL 7

Expert Comment

by:EYoung
ID: 34972937
Try making your column headers flat not raised and set the column header alignment to middle left.  I think that is about the best you can achieve.
0
 
LVL 10

Accepted Solution

by:
kdwood earned 500 total points
ID: 35036376

If I understand your question correctly, you can adjust the left padding value on the DataGridView Column to indent the data.  

You can do this from DefaultCellStyle property of the DataGridView or on each individual Columns DefaultCellStyle property.

You can also do this in code:

        Dim newPadding As New Padding(10, 1, 0, 0)
        YourDataGridView.RowTemplate.DefaultCellStyle.Padding = newPadding


Hope this helps.

Regards,

Keith
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 35321638
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

738 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