title: WPF Datagrid: copy additional rows to clipboard
body: <p>I am working with the WPF Datagrid and I am trying to enhance/change the copy &amp; paste mechanism.</p>
  
  <p>When the user selects some cells and then hit CTRL + C, the underlying controls is able to catch the <strong>CopyingRowClipboardContent</strong> event.</p>
  
  <pre><code> this.mainDataGrid.CopyingRowClipboardContent 
                += this.DatagridOnCopyingRowClipboardContent;
  </code></pre>
  
  <p>In this method, some cells are added to both the header and the rows, hence resulting in a "wider" grid.</p>
  
  <pre><code>    private void DatagridOnCopyingRowClipboardContent(
          object sender, 
          DataGridRowClipboardEventArgs dataGridRowClipboardEventArgs)
      {
          // this is fired every time a row is copied
          var allContent = dataGridRowClipboardEventArgs.ClipboardRowContent;
  
          allContent.Insert(0, new DataGridClipboardCellContent(
                                              null, 
                                              this.mainDataGrid.Columns[0], 
                                              "new cell"));
      }
  </code></pre>
  
  <p>At this point I am stuck because I am trying to add an additional row <strong>before</strong> the header and <strong>two after</strong> the last row (see image below).</p>
  
  <p>Any ideas? Suggestions?</p>
  
  <p>Please note I am not interested in an MVVM way of doing it here.</p>
  
  <p><img src="https://i.stack.imgur.com/lgX2i.png" alt="enter image description here"></p>