title: Paste from Excel to WPF DataGrid
body: <p>I have a DataGrid (called TheGrid) that I would like to implement copy and paste functionality on. The copy functionality works great but I don't know how to implement paste. Do I just need to get the data from the clipboard and parse myself?</p>
  
  <p>The command bindings:</p>
  
  <pre><code>&lt;Window.CommandBindings&gt;
      &lt;CommandBinding Command="Copy" Executed="CommandBinding_Executed" CanExecute="CommandBinding_CanExecute" /&gt;
      &lt;CommandBinding Command="Paste" Executed="CommandBinding_Executed" CanExecute="CommandBinding_CanExecute" /&gt;
  &lt;/Window.CommandBindings&gt;
  </code></pre>
  
  <p>The menu items:</p>
  
  <pre><code>&lt;MenuItem Header="{x:Static culture:TextResource.CopyMenuItem}" Command="Copy"/&gt;
  &lt;MenuItem Header="{x:Static culture:TextResource.PasteMenuItem}" Command="Paste"/&gt;
  </code></pre>
  
  <p>The code behind for CommandBinding_Executed:</p>
  
  <pre><code>private void CommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
  {
      if(e.Command.Equals(ApplicationCommands.Copy))
      {
          // This works great, wow that was easy!
          ApplicationCommands.Copy.Execute(null, TheGrid);
      }
      else if (e.Command.Equals(ApplicationCommands.Paste))
      {
          //What do I do here? Is there an easy way to paste like there was for copy?
          // Or do I need to grab data using Clipboard.GetData and parse it myself?
      }
  }
  </code></pre>