title: XAML - Collection->ListView->GridView->DataTemplate Column Fill-Width Binding issues
body: <p>I have the following View:</p>
  
  <pre><code>&lt;UserControl x:Name="userControl" x:Class="CallTypePriorityMapping.MapperView"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               xmlns:local="clr-namespace:CallTypePriorityMapping.Views"
               xmlns:ViewModels="clr-namespace:CallTypePriorityMapping.ViewModels"
               mc:Ignorable="d" 
               d:DesignHeight="300" d:DesignWidth="300"&gt;
      &lt;UserControl.DataContext&gt;
          &lt;ViewModels:CallTypeMappingsPresenter /&gt;
      &lt;/UserControl.DataContext&gt;
      &lt;Grid HorizontalAlignment="Stretch" x:Name="MappingGrid"&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="0.5*" x:Name="Col1"/&gt;
              &lt;ColumnDefinition Width="0.5*" x:Name="Col2"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="40"/&gt;
              &lt;RowDefinition Height="259*"/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Button x:Name="button" Content="+ New Mapping" Margin="10" Grid.Column="1" Command="{Binding AddMapping, UpdateSourceTrigger=PropertyChanged}"/&gt;
          &lt;ListView x:Name="listView" Grid.Row="1" Grid.ColumnSpan="2" ItemsSource="{Binding Mappings, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch"&gt;
              &lt;ListView.View&gt;
                  &lt;GridView&gt;
                      &lt;GridViewColumn Header="Call Type" x:Name="callTypeCol"&gt;
                          &lt;GridViewColumn.CellTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;ComboBox Margin="0" HorizontalAlignment="Stretch" x:Name="CallTypeName" ItemsSource="{Binding DBCallTypes, ElementName=userControl}" IsSynchronizedWithCurrentItem="True" DisplayMemberPath="Value"  SelectedItem="{Binding CallType.Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/GridViewColumn.CellTemplate&gt;
                      &lt;/GridViewColumn&gt;
                      &lt;GridViewColumn Header="Priority"&gt;
                          &lt;GridViewColumn.CellTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;ComboBox HorizontalAlignment="Stretch" x:Name="PriorityName" ItemsSource="{Binding DBPriorities, ElementName=userControl}" IsSynchronizedWithCurrentItem="True" DisplayMemberPath="Value" SelectedItem="{Binding Priority, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/GridViewColumn.CellTemplate&gt;
                      &lt;/GridViewColumn&gt;
                  &lt;/GridView&gt;
              &lt;/ListView.View&gt;
          &lt;/ListView&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/rCRap.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rCRap.png" alt="Screen Capture"></a></p>
  
  <p>This, for the most part, works, but I have a couple issues:</p>
  
  <p><strike>1. Changing either column's value on a single row also changes that value in all other rows.</strike> <em>Solved - See below comment from @Amine</em></p>
  
  <ol start="2">
  <li>I cannot get the columns &amp; comboboxes to auto-size (to equal portions of the fill width). The <code>Width</code> property on GridView &amp; GridView Columns will not accept <code>*</code> (or a percentage). I've tried Binding to the outer <code>Grid</code>'s <code>ActualWidth</code>, but that grid's <code>ActualWidth</code> property always returns <code>0</code> (even after hooking into the re-size event and setting a dependency property, then re-sizing and walking the code in debug). I've been searching and reading similar posts all over the web, but see a lot of people using <a href="https://stackoverflow.com/questions/16352829/listview-equal-width-for-all-columns" title="Code-Behind">Code-Behind</a> or <a href="https://stackoverflow.com/questions/7558795/how-can-i-make-my-grid-columns-always-be-the-same-width" title="GridColumnDefinitions">GridColumnDefinitions</a> (which seems to only exist in the <code>Grid</code> control, not the <code>GridView</code> control). I've also found many ways to solve this by replacing the GridView with another class, but have found no XAML-only solution using the GridView class. Am I missing something?</li>
  </ol>