title: How to make the last column in WPF datagrid take all the left space, always?
body: <p>Standard WPF 4 Datagrid.</p>
  <p>Let' say I have datagrid 200 pixels wide, and 2 columns. I would like the columns take always entire space, meaning if the user resizes the first column to 50 pixels, the last one would be 150.</p>
  <p>Initially I set width 100 pixels for the 1st column, and * for the last one (in XAML).</p>
  <p>I thought the problem is with removing the virtual, 3rd column, as explained here:</p>
  <p><a href="http://wpf.codeplex.com/Thread/View.aspx?ThreadId=58939" rel="noreferrer">http://wpf.codeplex.com/Thread/View.aspx?ThreadId=58939</a></p>
  <p>but there is no difference really -- still, when resizing the columns, I get some extra space on right -- with virtual column, it is a virtual column (white color by default), without it, it is empty space (gray by default).</p>
  <p><strong>QUESTION</strong>: how to enforce the constraint, that no matter how the user resizes the columns,</p>
  <pre><code>sum(columns width)==datagrid width
  </code></pre>
  <p>?</p>
  <h2>Edits</h2>
  <p>Yes, I use WPF 4.</p>
  <p><strong>WORKAROUND</strong></p>
  <p>I marked one of the answers as solution, but actually it is not a solution due to WPF design. It is simply what WPF can do at best, and it is not very good -- first of all the option CanUserResize for column means really IsResizeable and this option when turned on contradicts Width set to *. So without some really smart trick you end up with:</p>
  <ul>
  <li><p>datagrid which last column in superficially resizable but in fact it is not, and little space on right is shown (i.e. the virtual column is not resizable) -- for last column: CanUserResize=true, Width=*</p>
  </li>
  <li><p>datagrid which last column cannot be resized by user and it is shown accordingly, initially no space on right is shown, but it can be shown when user resizes any element of datagrid -- for last column: CanUserResize=false, Width=*</p>
  </li>
  </ul>
  <p>So far I can see two problems with WPF datagrid:</p>
  <ul>
  <li>misleading naming</li>
  <li>contradiction of features</li>
  </ul>
  <p>I am still all ears to how really solve this issue.</p>