title: Listbox with horizontal scrollbar
body: <p>I have a listbox filled with usercontrols. When i populate the listbox i get a vertical scrollbar as i should but i also get an unnessecary horizontal scrollbar in the listbox. I have tried to create a converter for the listboxitem , but the converter is never called.</p>
  
  <pre><code>     &lt;ListBox.Resources&gt;
                  &lt;local:ControlWidthConverter x:Key="widthConverter" /&gt;
              &lt;/ListBox.Resources&gt;
              &lt;ListBox.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
  
                      &lt;!--Manages click on child controls so listitem is selected--&gt;
                      &lt;Controls:ComponentEditItem   HorizontalAlignment="Left"
                          Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBox}},
  Path=ActualWidth, Converter={StaticResource widthConverter}}"&gt;
  
                          &lt;Controls:ComponentEditItem.Triggers&gt;
                              &lt;EventTrigger RoutedEvent="GotFocus"&gt;
                                  &lt;BeginStoryboard&gt;
                                      &lt;Storyboard&gt;
                                          &lt;BooleanAnimationUsingKeyFrames Duration="00:00:00" Storyboard.Target="{Binding Path=., RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Storyboard.TargetProperty="IsSelected"&gt;
                                              &lt;DiscreteBooleanKeyFrame Value="True" /&gt;
                                          &lt;/BooleanAnimationUsingKeyFrames&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/BeginStoryboard&gt;
                              &lt;/EventTrigger&gt;
                          &lt;/Controls:ComponentEditItem.Triggers&gt;
                      &lt;/Controls:ComponentEditItem&gt;
  
                  &lt;/DataTemplate&gt;
              &lt;/ListBox.ItemTemplate&gt;
  
              &lt;ListBox.ItemsPanel&gt;
                  &lt;ItemsPanelTemplate&gt;
                      &lt;VirtualizingStackPanel Orientation="Horizontal" /&gt;
                  &lt;/ItemsPanelTemplate&gt;
              &lt;/ListBox.ItemsPanel&gt;
  </code></pre>
  
  <p>The converter</p>
  
  <pre><code>   public class ControlWidthConverter : IValueConverter
      {
  
          #region IValueConverter Members
  
          public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
          {
              double result = (double)value;
  
              if (!Double.IsNaN(result))
              {
                  result = result - 20;
              }
              else
              {
                  result = 100D;
              }
  
              return result;
          }
  
          public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
          {
              throw new System.NotImplementedException("Not implemented.");
          }
  
          #endregion
      } 
  </code></pre>
  
  <p>Anyone has an idea why the converter is not called. Or how to remove the horizontal scrollbar</p>