title: How do I make a WPF data template fill the entire width of the listbox?
body: <p>I have a <code>ListBox</code> <code>DataTemplate</code> in WPF. I want one item to be tight against the left side of the <code>ListBox</code> and another item to be tight against the right side, but I can't figure out how to do this.</p>
  
  <p>So far I have a <code>Grid</code> with three columns, the left and right ones have content and the center is a placeholder with it's width set to "*". Where am I going wrong?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;DataTemplate x:Key="SmallCustomerListItem"&gt;
      &lt;Grid HorizontalAlignment="Stretch"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition/&gt;
              &lt;ColumnDefinition Width="*"/&gt;
              &lt;ColumnDefinition/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;WrapPanel HorizontalAlignment="Stretch" Margin="0"&gt;
              &lt;!--Some content here--&gt;
              &lt;TextBlock Text="{Binding Path=LastName}" TextWrapping="Wrap" FontSize="24"/&gt;
              &lt;TextBlock Text=", " TextWrapping="Wrap" FontSize="24"/&gt;
              &lt;TextBlock Text="{Binding Path=FirstName}" TextWrapping="Wrap" FontSize="24"/&gt;
  
          &lt;/WrapPanel&gt;
          &lt;ListBox ItemsSource="{Binding Path=PhoneNumbers}" Grid.Column="2" d:DesignWidth="100" d:DesignHeight="50"
       Margin="8,0" Background="Transparent" BorderBrush="Transparent" IsHitTestVisible="False" HorizontalAlignment="Stretch"/&gt;
      &lt;/Grid&gt;
  &lt;/DataTemplate&gt;
  </code></pre>