Solved

DataGridView Header Indents

Posted on 2011-02-24
4
1,026 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

679 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