How to set the DataGridViewCell to automatically word wrap?

前端 未结 5 907
清酒与你
清酒与你 2020-12-16 11:39

The code below which I found on MSN did not worked to automatically word-wrap a cell:

dataGridView.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.D         


        
5条回答
  •  生来不讨喜
    2020-12-16 11:59

    You also need to set DataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells (along with what you have done) for word-wrap to work.

提交回复
热议问题