开发者

How to fix DataGridView RowHeader text wrapping problem?

开发者 https://www.devze.com 2023-01-05 14:15 出处:网络
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:

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
0

精彩评论

暂无评论...
验证码 换一张
取 消