Skip to main content

By default, text in a DataGridViewTextBoxCell does not wrap. This can be controlled via the WrapMode property on the cell style (e.g. DataGridView.DefaultCellStyle.WrapMode).

Set the WrapMode property of a DataGridViewCellStyle to one of the DataGridViewTriState enumeration values. 

The following code example uses the DataGridView.DefaultCellStyle property to set the wrap mode for the entire control.

this.dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;

- Advertisement -
- Advertisement -