Virtualizingstackpanel loses selected value on combobox winrt

106 views Asked by At

I have a simple ListBox with about 500 ListBox item. I have 2 comboboxes on one item.

My problem is: When I scroll down I lose all SelectedItem binding data.

I have tried to replace the Virtualizingstackpanel to Stackpanel, but than it eats all of my computer's RAM. So I need to get it work with Virtualizingstackpanel.

The question is: How can I bind selected items to Comboboxes they are on listboxItems?

the code:

<DataTemplate x:Key="MyViewTemplate6">
    <Grid Height="110" Width="480" Margin="10" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <ComboBox HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" ItemTemplate="{StaticResource TypeTemplate7}" ItemsSource="{Binding Types}" SelectedItem="{Binding Type, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
    </Grid>
</DataTemplate>

This is in my ItemTemplate in ListBox.

0

There are 0 answers