Click here to Skip to main content
15,880,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working on a win 8 app. I have a listview with combobox inside datatemlate. Now problem occurs when I scroll listview, combobox loses selectedvalue infact while scrolling listview combobox selectedValueChanged event fires.

C#
<ListView x:Name="lstQuestion" Margin="0 10 0 0" SelectionMode="None"                         
    ItemsSource="{Binding QuestionsViewModel.AuditQuestionList}" IsItemClickEnabled="True" >
    <ListView.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Vertical" Margin="10 0 0 0">
                <TextBlock Text="{Binding QuestionText}" Padding="14,10,10,10" FontSize="14" TextWrapping="Wrap"/>
                <StackPanel Orientation="Horizontal">

                    <Rectangle ToolTipService.ToolTip="{Binding QuestionText}" x:Name="rectAnswerColor"  Fill="{Binding ProgressColor, Converter={StaticResource HexToSolidColorConverter}}" Width="5" Height="40"/>
                    <ComboBox x:Name="cmbanswer" Margin="10 0 0 0"   Height="40" HorizontalAlignment="Left" Width="200" ItemsSource="{Binding PossibleAnswerList}" Visibility="{Binding QuestionType, Converter={StaticResource IntToVisibility1}}" SelectionChanged="cmbanswer_SelectionChanged_1" />

                    <TextBox x:Name="txtAnswer" Margin="10 0 0 0" Height="40" Width="200" Visibility="{Binding QuestionType, Converter={StaticResource IntToVisibility2}}" LostFocus="txtAnswer_LostFocus_1"/>

                    <Image x:Name="imgcamera" Source="/Assets/camera.png" Height="35" Width="30" Margin="15 0 0 0" Tapped="imgcamera_Tapped_1"/>

                    <Border x:Name="brdBackground" Margin="-8 -20 0 0" removed="Red" CornerRadius="10" Height="22" Width="22" >
                        <TextBlock x:Name="tblImageCount" Text="+"  Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
                    </Border>

                    <Image x:Name="imgnote" Source="/Assets/notepad.png" Height="30" Width="30" Margin="15 0 0 0" Tapped="imgnote_Tapped"/>
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

Is there any problem?
Posted
Comments
mayankkarki 13-Feb-14 6:08am    
Anyone there to help?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900