title: WPF - Listview Databound Column Width Problem
body: <p>Given below xaml using .Net3.5 -</p>
  
  <pre><code>&lt;ListView Name="RawData" AlternationCount="2" ItemsSource="{Binding}"
            ScrollViewer.VerticalScrollBarVisibility="Visible" Grid.Row="1"
            Grid.ColumnSpan="4"
            IsSynchronizedWithCurrentItem="True"
            sorter:GridViewSort.AutoSort="True"
            sorter:GridViewSort.ShowSortGlyph="False" &gt;
      &lt;ListView.ItemContainerStyle&gt;
          &lt;Style TargetType="ListViewItem"&gt;
              &lt;Setter Property="HorizontalContentAlignment" Value="Center" /&gt;
              &lt;Style.Triggers&gt;
                  &lt;Trigger Property="ItemsControl.AlternationIndex" Value="1"&gt;
                      &lt;Setter Property="Background" Value="LightGray"&gt;&lt;/Setter&gt;
                  &lt;/Trigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/ListView.ItemContainerStyle&gt;
      &lt;ListView.View&gt;
          &lt;GridView&gt;
              &lt;GridViewColumn Header="Date" DisplayMemberBinding="{Binding Path=GetDate}"
                              Width="Auto" sorter:GridViewSort.PropertyName="GetDateTime"/&gt;
              &lt;GridViewColumn Header="Time" DisplayMemberBinding="{Binding Path=GetTime}"
                              Width="Auto" sorter:GridViewSort.PropertyName="GetDateTime"/&gt;
              &lt;GridViewColumn Header="Scan Time" DisplayMemberBinding="{Binding Path=ScanTimeSec}"
                              sorter:GridViewSort.PropertyName="ScanTimeSecond"  Width="Auto"/&gt;
              &lt;GridViewColumn Header="Ping Time" DisplayMemberBinding="{Binding Path=PingTimeSec}"
                              sorter:GridViewSort.PropertyName="PingTimeSec"  Width="Auto" /&gt;
              &lt;GridViewColumn Header="Fault Messages"
                              DisplayMemberBinding="{Binding Path=ErrorMessages}"
                              sorter:GridViewSort.PropertyName="ErrorMessages" Width="Auto"/&gt;
          &lt;/GridView&gt;
      &lt;/ListView.View&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>My problem is with the first and last columns.  They are not automatically resizing to fit the contents of the data.  I could use a fixed width, but that will cause problems later in the project when I let users adjust font size.</p>
  
  <p>Every solution I've found seems to be to set the width="auto" and WPF will do this for you.  However, it doesn't do it.  So as a bit of a newbie at WPF, I'm not sure what to do.</p>