I have dataGridView with a particular column. When I write long text in dataGridView it shows me a shortened version, with ellipses, because the column isn't wide enough to display the entire string.
| textdsadasda... |
What do I must to do if I want to dataGridView show this text in next line, or wrap the text?
| textdsadasda |
| dasdasa | (continuation of line above)
How can this be done?
There is no need to reinvent the wheel by repainting the cell.
Instead simply:
AutoSizeRowsMode property to AllCells. This allows row height to
grow with any wrapped text. DataGridView.DefaultCellStyle.WrapMode
to DataGridViewTriState.True to wrap text in the cells. DataGridView.AutoSizeColumnsMode to
DataGridViewAutoSizeColumnsMode.None so that the columns don't resize themselves
(so they remain at the user specified width).After that the text should wrap to the next line if there is not enough space in the column.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With