title: How can you enforce width limit of a DataGridView column, and ensure text wraps if it exceeds it?
body: <p>I am having trouble enforcing the column width limit in my DataGridView table. Right now, texts in columns # 1 &amp; 2 can be really long, but column #2 can be exceptionally long where I have to scroll a lot to the right (this is why I don't want to make the width the width of the largest cell). Sometimes, the text cuts off too and unless you hover over it, you won't know there's more text. I used the &quot;Fill&quot; method for the last column, because if the texts in columns #1 and #2 are not that long, column #3 should fill the rest of the space in the DataGridView. This is what it currently looks like:</p>
  <pre><code>KEY COLUMN |  VALUE COLUMN                                                     | UPDATE COLUMN
  -----------------------------------------------------------------------------------------------
  fine       | this width can also be very long,but doesn't cut off where it ends|
  ----------------------------------------------------------------------------------------------- 
  fine length| this width can also vary                                          | fine length
  -----------------------------------------------------------------------------------------------
  fine width | this width is usually extremely long but cuts off and i have to sc| fine width
  </code></pre>
  <p>^ Notice in the last row, for example, the text might cut off and you have to hover over it to read the rest.</p>
  <p>This is what I want it to look like (I want there to be a limit to the size of all 3 columns, but columns #1 and #3 should be relatively the same size, and column #2 cell width limit should be a bit larger because the text content can be a bit more. However, all 3 should support wraparound text:</p>
  <pre><code>KEY COLUMN |  VALUE COLUMN                                | UPDATE COLUMN
  -----------------------------------------------------------------------------------------------
  fine       | this width can also be very long, but doesn't| 
             | cut off where it ends                        |
  -----------------------------------------------------------------------------------------------
  fine length| this width can also vary                     | fine length
  -----------------------------------------------------------------------------------------------
  fine width | this width is usually extremely long but cuts| fine width
             | off and i have to scroll to see the rest of  |
             | the text                                     |
  </code></pre>
  <p>This is what I've tried, from reading responses here on Stackoverflow:</p>
  <pre><code>mydatagrid.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
  mydatagrid.Columns[1].Width = 400;
  mydatagrid.Columns[1].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
  mydatagrid.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
  mydatagrid.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
  </code></pre>
  <p>But this is what gives me the first table. Any pointers?</p>