title: WPF DevExpress LookUpEdit Popup Too High
body: <p>I'm using a DevExpress LookUpEdit component in a WPF UserControl.  My problem is that the popup rectangle is always much bigger that the contents of the items in the PopupContentTemplate.  I can't seem to find a property that governs this or maybe I'm going about using the controls improperly (?).</p>
  
  <p>Thanks</p>
  
  <p><img src="https://i.stack.imgur.com/tUf56.jpg" alt="enter image description here"></p>
  
  <pre><code>&lt;UserControl xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"  
      x:Class="FTI_Opp_WPF.Views.UserControls.ViewSelector"
      xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d"&gt;
      &lt;UserControl.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;ResourceDictionary.MergedDictionaries&gt;
                  &lt;ResourceDictionary
                      Source="../../Common/Styles.xaml" /&gt;
                  &lt;ResourceDictionary
                      Source="../../Common/Strings.xaml" /&gt;
              &lt;/ResourceDictionary.MergedDictionaries&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/UserControl.Resources&gt;
  
      &lt;Grid&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="auto"/&gt;
              &lt;ColumnDefinition Width="*"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
  
          &lt;Label Grid.Column="0" FontSize="12" Foreground="gray" Margin="0,-2,1,0"&gt;View:&lt;/Label&gt;
  
          &lt;dxg:LookUpEdit
              Grid.Column="1"
              dx:ThemeManager.ThemeName="MetropolisLight"
              Name="viewLookupEdit"
              AutoPopulateColumns="False"
              AutoComplete="True"
              IncrementalFiltering="True"
              ImmediatePopup="True"
              IsReadOnly="True"
              HorizontalAlignment="Right"
              VerticalAlignment="Top"
              Text="{Binding SelectedViewName}"
              ShowSizeGrip="false"
              MinWidth="200"&gt;
              &lt;dxg:LookUpEdit.PopupContentTemplate&gt;
                  &lt;ControlTemplate&gt;
                      &lt;StackPanel Orientation="Vertical" Height="auto"&gt;
                          &lt;ListBox Name="lstMain" 
                                   ItemsSource="{Binding Path=GridViews}" 
                                   HorizontalAlignment="Stretch"
                                   BorderThickness="1"
                                   MouseUp="OnRowMouseUp"&gt;
                              &lt;ListBox.ItemContainerStyle&gt;
                                  &lt;Style
                                      TargetType="{x:Type ListBoxItem}"&gt;
                                      &lt;Setter Property="BorderThickness"&gt;
                                          &lt;Setter.Value&gt;1&lt;/Setter.Value&gt;
                                      &lt;/Setter&gt;
                                      &lt;Setter
                                          Property="Template"&gt;
                                          &lt;Setter.Value&gt;
                                              &lt;ControlTemplate
                                                  TargetType="{x:Type ListBoxItem}"&gt;
                                                  &lt;Grid Name="gridView" Height="25"&gt;
                                                      &lt;Grid.ColumnDefinitions&gt;
                                                          &lt;ColumnDefinition Width="14"/&gt;
                                                          &lt;ColumnDefinition Width="*"/&gt;
                                                      &lt;/Grid.ColumnDefinitions&gt;
  
                                                      &lt;Image Grid.Column="0"
                                                          Margin="0,-2,0,0"
                                                          Visibility="Visible"
                                                          Source="..\..\Images\globe.png"
                                                          Height="12"
                                                          Width="12" /&gt;
  
                                                      &lt;TextBlock 
                                                          Margin="2,3,0,0" 
                                                          Grid.Column="1" 
                                                          Name="viewName" 
                                                          VerticalAlignment="Stretch"  
                                                          Text="{Binding Path=Name}"/&gt;
                                                  &lt;/Grid&gt;
                                                  &lt;ControlTemplate.Triggers&gt;
                                                      &lt;Trigger
                                                          Property="IsMouseOver"
                                                          Value="true"&gt;
                                                          &lt;Setter
                                                              TargetName="gridView"
                                                              Property="Background" Value="{Binding Converter={StaticResource StyleConverter},ConverterParameter=HOVER_BACKGROUND_COLOR}"&gt;
                                                          &lt;/Setter&gt;
                                                          &lt;Setter
                                                              TargetName="viewName"
                                                              Property="Foreground" Value="White"&gt;
                                                          &lt;/Setter&gt;
                                                          &lt;Setter
                                                              TargetName="viewName"
                                                              Property="FontWeight" Value="BOLD"&gt;
                                                          &lt;/Setter&gt;
                                                      &lt;/Trigger&gt;
                                                  &lt;/ControlTemplate.Triggers&gt;
                                              &lt;/ControlTemplate&gt;
                                          &lt;/Setter.Value&gt;
                                      &lt;/Setter&gt;
  
                                      &lt;Style.Triggers&gt;
                                          &lt;DataTrigger
                                              Binding="{Binding Path=IsEnabled}"
                                              Value="False"&gt;
                                              &lt;Setter
                                                  Property="IsEnabled"
                                                  Value="{Binding Path=IsEnabled}" /&gt;
                                          &lt;/DataTrigger&gt;
                                      &lt;/Style.Triggers&gt;
                                  &lt;/Style&gt;
                              &lt;/ListBox.ItemContainerStyle&gt;
                          &lt;/ListBox&gt;
                          &lt;Button
                              Name="btnAdvanced"
                              Margin="10,0,0,0"
                              Style="{StaticResource Link}"
                              Content="manage views"
                              Click="OnManageViewsClick" /&gt;
  
                      &lt;/StackPanel&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/dxg:LookUpEdit.PopupContentTemplate&gt;
          &lt;/dxg:LookUpEdit&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>