title: Copy text from DataGrid cell
body: <p>I want to be able to copy text from DataGrid Cell.</p>
  
  <ol>
  <li>First possible solution could be setting <code>SelectionUnit</code> to <code>Cell</code> but that's not an option for me since I need to select <code>FullRow</code></li>
  <li>Second possible approach was to have <code>DataGridTemplateColumn</code> with readonly <code>TextBox</code> in it. But there is an issue with styles. My previous question: <a href="https://stackoverflow.com/q/15007273/1456174">DatagridCell style overriden by TextBox style</a>. I need really bright color for text in row, but really dark in selected row.</li>
  <li><p>Third is to set IsReadOnly="False" on DataGrid and provide <code>EditingElementStyle</code>for <code>DataGridTextColumn</code> </p>
  
  <pre><code>&lt;Style x:Key="EditingStyle" TargetType="{x:Type TextBox}"&gt;
  &lt;Setter Property="IsReadOnly" Value="True"/&gt;
  &lt;/Style&gt;
  ...  
  &lt;DataGridTextColumn ... EditingElementStyle="{DynamicResource EditingStyle}"/&gt;
  </code></pre>
  
  <p>But here comes a really terrible bug <a href="https://connect.microsoft.com/VisualStudio/feedback/details/624239/wpf-datagrid-text-column-allows-one-character-text-enter-when-the-internal-text-box-is-set-to-read-only" rel="nofollow noreferrer">WPF Datagrid Text Column allows one character text enter when the internal text box is set to read only.</a></p></li>
  </ol>
  
  <p>Do you know about some different solution for this? Or workaround? Thank you.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I noticed that <code>DataGrid</code> from <a href="http://wpftoolkit.codeplex.com/wikipage?title=DataGrid&amp;referringTitle=Home" rel="nofollow noreferrer"><em>Extended WPF Toolkit</em></a> doesn't have this <strong>bug</strong>, but it seems it has different structure and I wouldn't be able ty apply my DataGrid Style. </p>
  
  <p>I noticed that using ReadOnly TextBox as EditingElementStyle of DataGridColumn brings further problems. When you use <strong>OneWay</strong> binding then it's not possible to get cell to <strong>Editing state</strong>. It's not acceptable to let the user override for example <strong>ID</strong> of some entity displayed in DataGrid. So it has to be somehow readonly or at least <strong>OneWay</strong> binding.</p>
  
  <p>At this moment I have no solution for this at all. Is there any other way to let the user copy from cell while the row is selected and highlighted? Have I failed to notice some other solution? Thanks for reading. </p>