Page 1 of 1

[SOLVED] Combobox badly broken in 9.2

Posted: Mon Sep 12, 2016 10:13 am
by rkmore
I just updated a project to 9.2 and all of the comboboxes are no longer able to be filled at runtime.

I can't get any combobox to display anything in the dropdown. I have tried adding them as an ItemsSource, and adding them in code.
The combobox appears to simply not work! Below is one attempt but I have tried many others.

Code: Select all

<Page
    x:Class="Application3.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Application3"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <StackPanel>
        <ComboBox x:Name="combo1" />
    </StackPanel>
</Page>


Fill as follows

Code: Select all

    public partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();

            combo1.Items.Add("Item 1");
            combo1.Items.Add("Item 2");
            combo1.Items.Add("Item 3");
            combo1.Items.Add("Item 4");
            combo1.Items.Add("Item 5");
        }
    }


The dropdown contains nothing.

Surely there must be some way to get it to work. It must have worked in regression testing ?!?!? What am I doing wrong here (this worked in previous versions)

How can I work around this? Please help!

Re: HELP! Combobox badly broken in 9.2

Posted: Tue Sep 13, 2016 12:05 am
by JS-Support @Userware
Hi,

Sorry we did a mistake while fixing the other issues of the ComboBox. The regression tests didn't include adding items while the ComboBox was still not in the visual tree. We are going to provide a fix to this issue in just a few days.

In the meantime, please add the items while the ComboBox is in the visual tree. For example, you can do it in the "Loaded" event, like this:

Code: Select all

public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();

        this.Loaded += MainPage_Loaded;
    }

    private void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
        combo1.Items.Add("Item 1");
        combo1.Items.Add("Item 2");
        combo1.Items.Add("Item 3");
        combo1.Items.Add("Item 4");
        combo1.Items.Add("Item 5");
    }
}


An alternative workaround is to set the "UseNativeComboBox" property to false, like this: <ComboBox UseNativeComboBox="False"/>

Thanks.
Regards,
JS-Support

Re: HELP! Combobox badly broken in 9.2

Posted: Mon Sep 19, 2016 5:08 am
by JS-Support @Userware
Now fixed in Beta 9.3.

Thanks.
JS-Support