title: Stretch Width of WPF RichTextBox within a TreeView
body: <p>My objective is simply to have a RichTextBox consume the entire row width inside a TreeView. The XAML below will produce a TreeView with a RichTextBox element, but the width is only 1 character wide.</p>
  
  <p>I have encountered the posts below concerning width Bugs in RichTextBox.  These issues may have been fixed since a standalone RichTextBox has the expected width.  Despite this I still tried creating Grids, setting Alignments to Stretch, and binding the FlowDocument PageWidth to parent without success.</p>
  
  <p>[NEW]
  I am adding a description of my application in case some would like to propose RTB alternatives.  I have a TreeView that contains between 10-1000 RTB nodes.  TextBox and TextBlock are not practical because I need full formatting and user editing.</p>
  
  <p><a href="https://stackoverflow.com/questions/350863/wpf-richtextbox-with-no-width-set">WPF RichTextBox with no width set</a></p>
  
  <p><a href="https://stackoverflow.com/questions/3891653/a-wpf-richtextbox-button-in-a-stackpanel-what-a-mess">A WPF RichTextBox + Button in a StackPanel =&gt; what a mess?</a></p>
  
  <pre><code>&lt;TreeView&gt;
      &lt;RichTextBox&gt;
          &lt;FlowDocument&gt;
              &lt;Paragraph&gt;
                  &lt;Run&gt;
                      Hello
                  &lt;/Run&gt;
              &lt;/Paragraph&gt;
          &lt;/FlowDocument&gt;
      &lt;/RichTextBox&gt;
  &lt;/TreeView&gt;
  </code></pre>
  
  <p>Thanks,</p>