title: How to bind datagrid columns width in WPF (MVVM)
body: <p>I am trying to bind a datagrid columns width but not working.</p>
  
  <pre><code>&lt;DataGridTextColumn Binding="{Binding Name}" Width="{Binding GridNameWidth}" Header="Name" /&gt;
  </code></pre>
  
  <p>Here is the backend code:</p>
  
  <pre><code>public int GridNameWidth
  {
      get
      {
          return 300;
      }
  }
  </code></pre>
  
  <p>The backend code is never touched. There are no errors but the <code>name</code> field has a default width. I'd like to make width bind to my property. I don't need two-way binding just need the width to be binded when the grid loads. Is this possible in wpf?</p>