Tigyi János
Tigyi János

Reputation: 31

Virtualizingstackpanel loses selected value on combobox winrt

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.

Upvotes: 0

Views: 104

Answers (0)

Related Questions