How to let "DataGridViewTextBoxColumn" in DataGridView supports Multiline property?
You should be able to achieve this by setting the WrapMode of the DefaultCellStyle of your DataGridViewTextBoxColumn to true.
I have found that there are two things that you need to do, both in the designer, to make a text cell show multiple lines. As Tim S. Van Haren mentioned, you need to set WrapMode of the DefaultCellStyle of your DataGridViewTextBoxColumn to true. And although that does make the text wrap, it doesn't make the row expand to show anything beyond the first line. In addition to WrapMode, the AutoSizeRowsMode of the DataGridView must be set to the appropriate DataGridViewAutoSizeRowsMode enumeration value. A value such as DataGridViewAutoSizeRowsMode.AllCells allows the cell to expand vertically and show the entire wrapped text.
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