title: How to auto stretch a column of a ListView to fill the containing Grid in WPF?
body: <p>I have created a ListView made up from 2 columns: "File Name" and "Size (MB)". This ListView is contained in a Grid. Since file names are likely to be longer than file sizes, I want to allot as much width as possible for the 'file name' column without damaging the 'size' column.
  In other words, I want the 'size' column to fit its content and the 'file name' column to fill the rest of the grid.</p>
  
  <p>I have been playing with many parameters, but could achieve my goal.</p>
  
  <p>My last try looks like this:</p>
  
  <pre><code>                &lt;ListView Name="BrowseFilesListView"&gt;                        
                      &lt;ListView.ItemContainerStyle&gt;
                          &lt;Style TargetType="ListViewItem"&gt;
                              &lt;Setter Property="HorizontalContentAlignment" Value="Stretch" /&gt;
                          &lt;/Style&gt;
                      &lt;/ListView.ItemContainerStyle&gt;                        
                      &lt;ListView.View&gt;
                          &lt;GridView&gt;                               
                              &lt;GridViewColumn Header="File Name"&gt; 
                                  &lt;GridViewColumn.CellTemplate&gt;
                                      &lt;DataTemplate&gt;
                                          &lt;TextBlock Text="{Binding Name}" HorizontalAlignment="Stretch"/&gt;
                                      &lt;/DataTemplate&gt;
                                  &lt;/GridViewColumn.CellTemplate&gt;
                              &lt;/GridViewColumn&gt;
                              &lt;GridViewColumn Width="Auto" Header="Size (MB)" DisplayMemberBinding="{Binding Path=Size}"/&gt;
                          &lt;/GridView&gt;
                      &lt;/ListView.View&gt;
                  &lt;/ListView&gt;
  </code></pre>
  
  <p>Can anyone help me?</p>