Solved

DataGridView Header Indents

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Simple Linear Regression

705 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