Is it possible to prevent a multi line HeaderText in a DataGridView?
The ColumnHeadersDefaultCellStyle
property of the DataGridView
has a boolean property called WrapMode
. This is true by default. Make it false to set the required behaviour.
if you want to stop multiline text in DataGridView control then Wrap Mode should be false and set padding
You can not directly set it to false. The correct way of setting it to false is:
this.dataGridView1.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;