Solved

DataGridView Header Indents

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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.
This is about my first experience with programming Arduino.

789 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