Solved

DataGridView Header Indents

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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 …

706 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

18 Experts available now in Live!

Get 1:1 Help Now