views:

31

answers:

2

I am trying to decrease the height of DataGridView rows to allow showing as much of theme. But all my best effort produces the following result:

alt text

These are the settings used for the RowHeaderDefaultCellStyle:

aGrid.RowHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
aGrid.RowHeadersDefaultCellStyle.BackColor = Color.DarkGray
aGrid.RowHeadersDefaultCellStyle.ForeColor = Color.Black
aGrid.RowHeadersDefaultCellStyle.Font = New Font("Arial", 12, FontStyle.Regular, GraphicsUnit.Pixel)
aGrid.RowHeadersDefaultCellStyle.Format = "X4"    
aGrid.RowHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False

Look at the RowHeaders, the text is truncated and ugly.

Do you have any idea how can I improve it, without reducing the font size or increasing the height of the row?

+1  A: 

You want to reduce the Padding in the cell.

I set the Padding to 0, nothing changes. aGrid.RowHeadersDefaultCellStyle.Padding = New Padding(0)
marco.ragogna
+1  A: 

Another option would be to increase the row height.

 aGrid.RowTemplate.Height = 15
Michael Eakins