title: How can I make my Grid Columns always be the same width?
body: <p>If I set the Column's width to <code>*</code>, they're the same width initially but if an item is larger than the amount allowed then it will stretch the column width.</p>
  
  <p>How can I force my Grid to keep it's columns the same size with explicitly defining a size?</p>
  
  <p>I cannot use a UniformGrid because this Grid is being used in an ItemsControl, and the Items need to be placed in specific <code>Grid.Row</code>/<code>Grid.Column</code> spots</p>
  
  <p><strong>Edit</strong> Here's a sample of my current code. </p>
  
  <pre><code>&lt;DockPanel&gt;
  
      &lt;!-- Not showing code here for simplicity --&gt;
      &lt;local:ColumnHeaderControl DockPanel.Dock="Top" /&gt;
      &lt;local:RowHeaderControl DockPanel.Dock="Left" /&gt;
  
      &lt;ItemsControl ItemsSource="{Binding Events}"&gt;
          &lt;ItemsControl.ItemContainerStyle&gt;
              &lt;Style&gt;
                  &lt;Setter Property="Grid.Column" 
                          Value="{Binding DueDate.DayOfWeek, 
                              Converter={StaticResource EnumToIntConverter}}" /&gt;
              &lt;/Style&gt;
          &lt;/ItemsControl.ItemContainerStyle&gt;
  
          &lt;ItemsControl.ItemsPanel&gt;
              &lt;ItemsPanelTemplate&gt;
                  &lt;Grid&gt;
                      &lt;Grid.ColumnDefinitions&gt;
                          &lt;ColumnDefinition Width="*" /&gt;
                          &lt;ColumnDefinition Width="*" /&gt;
                          &lt;ColumnDefinition Width="*" /&gt;
                          &lt;ColumnDefinition Width="*" /&gt;
                          &lt;ColumnDefinition Width="*" /&gt;
                          &lt;ColumnDefinition Width="*" /&gt;
                          &lt;ColumnDefinition Width="*" /&gt;
                      &lt;/Grid.ColumnDefinitions&gt;
                  &lt;/Grid&gt;
              &lt;/ItemsPanelTemplate&gt;
          &lt;/ItemsPanel&gt;
      &lt;/ItemsControl&gt;
  
  &lt;/DockPanel&gt;
  </code></pre>
  
  <p><strong>Edit #2</strong> Here's my final solution. It makes the columns the correct size, and it keeps the size correct when the application gets resized.</p>
  
  <pre><code>&lt;ColumnDefinition Width="{Binding 
      ElementName=RootControl, 
      Path=ActualWidth, 
      Converter={StaticResource MathConverter}, 
      ConverterParameter=(@VALUE-150)/7}" /&gt;
  </code></pre>
  
  <p>150 is the width of the Row Headers + all margins and borders. I'm actually in the process of updating my <code>MathConverter</code> to an <code>IMultiValueConverter</code> so I can bind both parameters (If you're interested in the Converter code it can be found <a href="http://rachel53461.wordpress.com/2011/08/20/the-math-converter/" rel="noreferrer">here</a>, although it's only the single-value converter)</p>