I have DataGridView inside my WinForm. I set AutoSizeColumnsMode
to Fill
, because I need no white space if user resizes the window.
What I want to achieve. For example, user types some text in the certain cell. When text width becomes as cell width, text must go one the new line.
How it might be:
|Cell Header|
-------------
|text-text |
and
|Cell Header|
-------------
|text-text |
|more text |
|on the new |
|line |
My columns are resizable by user. So this:
|Cell Header|
-------------
|text-text |
|more text |
|on the new |
|line |
might go this:
|Cell Header |
---------------------
|text-text more text|
|on the new line |
What I have tried from other SO answers:
- set
AutoResizeRowsMode
toAllCells
- didn't help - set
DefaultCellStyle.WrapMode
toTrue
- ddin't help
How can I achieve this actually?
Edit: column settings:
Edit #2: