How to fix DataGridView RowHeader text wrapping problem?
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 http://img28.imageshack.us/img28/9572/datagridview.png
These are the settings used for the RowHeaderDefaultCellStyle
:
aGrid.RowHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
aGrid.RowHea开发者_开发百科dersDefaultCellStyle.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?
You want to reduce the Padding in the cell.
Another option would be to increase the row height.
aGrid.RowTemplate.Height = 15
精彩评论