locked
First item updated incorrectly in ComboBox while using StackPanel RRS feed

  • Question

  • Hi All,


    Currently, I am using WinRT ComboBox control in which I am using StackPanel for ItemPanelTemplate. When we set the SelectedItem in code behind, then text of first item is not updated correctly its returned as object instead of content. Here is the code I have used

      <ComboBox x:Name="MSComboTEst" Grid.Column="1"
          DisplayMemberPath="str" HorizontalAlignment="Center" ItemsSource="{Binding StringsTest}" Width="100" >
                    <ComboBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Vertical" />
                        </ItemsPanelTemplate>
                    </ComboBox.ItemsPanel>
       </ComboBox>

    Also, I have referred some of the sites regarding this and found that it is not possible to use StackPanel inside the ComboBox whether it is an known issue? If so, can you please help me in overcoming this issue?

    Link: https://stackoverflow.com/questions/26968357/strange-behaviour-of-combobox-in-winrt?noredirect=1&lq=1

    Thanks in advance

    Regards,

    Keerthana J




    Friday, September 28, 2018 10:57 AM

All replies

  • Combox Box for windows workflow implementation can be found here:

    https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/gg417193(v=vs.100) 

    It works differently to WPF. Unless you posted this question in the wrong forum.

    Thursday, October 4, 2018 12:55 PM