[SOLVED] Combobox badly broken in 9.2

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
rkmore
Posts: 55
Joined: Mon Dec 07, 2015 1:53 pm

[SOLVED] Combobox badly broken in 9.2

Postby rkmore » Mon Sep 12, 2016 10:13 am

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!

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: HELP! Combobox badly broken in 9.2

Postby JS-Support @Userware » Tue Sep 13, 2016 12:05 am

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

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: HELP! Combobox badly broken in 9.2

Postby JS-Support @Userware » Mon Sep 19, 2016 5:08 am

Now fixed in Beta 9.3.

Thanks.
JS-Support


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 31 guests

 

 

cron