How to center table in datagridview container

lotuseater

Member
Joined
Mar 31, 2009
Messages
5
Programming Experience
1-3
I have a DataGridView with its DataSource linked to an internal DataTable.
How do I center the table horizontally in the DataGridView container?
As you can see in the screenshot of my form below, it is justified to the top-left rather than the top-center.
 

Attachments

  • SelectUserScreenShot.JPG
    SelectUserScreenShot.JPG
    19 KB · Views: 32
Set AutoSizeMode for both columns to Fill. You may also select right Alignment for the DefaultCellStyle of the left column for the data to appear centered.
 
Back
Top