Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
755
Combobox does not strech automatically
posted

I have a grid that looks like follow:

 <Grid Grid.Column="0" Grid.Row="0" Margin="20,50,10,10"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="0.5*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> </Grid>

And inside the grid, I place a combobox:

<ComboBox Grid.Row="3" Grid.Column="1" FontWeight="Bold" FontSize="28" VerticalAlignment="Center" VerticalContentAlignment="Center" Padding="10,0,0,0" SelectedItem="{Binding Language, UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding Languages, UpdateSourceTrigger=PropertyChanged}" Margin="10,0,0,0"> <ComboBox.ItemContainerStyle> <Style TargetType="{x:Type ComboBoxItem}"> <Setter Property="FontSize" Value="28" /> </Style> </ComboBox.ItemContainerStyle> </ComboBox>

My problem is, that the combobox does not automatically fit the whole height of grid as you can see here: enter image description here

In contrast, the TextBox always fit the whole size of grid. How can I customize, that ComboBox auto fit to grid size?

I am using the thememanager with following code:

public partial class MainWindow : XamRibbonWindow
    {
        public MainWindow()
        {
            InitializeComponent();
            ThemeManager.ApplicationTheme = new Office2013Theme();
        }
    }

When I comment out the thememanager, then it works as I wish.