title: Wrap a long string into many lines in datagridview column
body: <p>I have a very long string in database(MS SQL) table such as</p>
  
  <pre><code>'99024','99050','99070','99143','99173','99191','99201','99202','99203','99204','99211','99212','99213','99214','99215','99217','99218','99219','99221','99222','99231','99232','99238','99239','99356','99357','99371','99374','99381','99382','99383','99384','99385','99386','99391','99392'
  </code></pre>
  
  <p>Right now it displays as in a datagridview of a windows form application.
  <img src="https://i.stack.imgur.com/r1s4m.png" alt="image 1"></p>
  
  <p>What I expected is likely as (ignore the headtext, it doesn't matter).
  <img src="https://i.stack.imgur.com/8AYjq.png" alt="image 2"> </p>
  
  <p>Which means to split a long string to many short strings. Each string occupies one line.
  Originally it was well done in asp.net gridview by the following code:</p>
  
  <pre><code>&lt;ItemTemplate&gt;
      &lt;div style="width: 75px; overflow: hidden; white-space: nowrap; word-wrap: break-word;"&gt;
           &lt;asp:TextBox ID="TextBox1" runat="server" Wrap="true" TextMode="MultiLine" Text='&lt;%# Eval("ICD9").ToString().Replace(",", Environment.NewLine.ToString())%&gt;'
            Rows='&lt;%# Eval("test").ToString().Split(new string[] { "," }, StringSplitOptions.None).Length %&gt;'
               &lt;/asp:TextBox&gt;
              &lt;/div&gt;
              &lt;/ItemTemplate&gt;
   &lt;EditItemTemplate&gt;
          &lt;div style="width: 75px; overflow: hidden; white-space: nowrap; word-wrap: break-word;"&gt;
                &lt;asp:TextBox ID="TextBox2" runat="server" Wrap="true" TextMode="MultiLine" Text='&lt;%# Eval("ICD9").ToString().Replace(",", Environment.NewLine.ToString())%&gt;
     '&gt;
                         &lt;/asp:TextBox&gt;
                              &lt;/div&gt;
                          &lt;/EditItemTemplate&gt;
  </code></pre>
  
  <p>Now I want to use it in windows form DataGridView, I don't know how to edit the column to customize the item. But I just thought that they could be similar.</p>
  
  <p>Thanks for help.</p>